Completed
Push — master ( 429a0d...552101 )
by greg
57s
created

test/reference.js   A

Complexity

Total Complexity 3
Complexity/F 1

Size

Lines of Code 32
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 0
wmc 3
c 2
b 0
f 0
nc 1
mnd 0
bc 3
fnc 3
dl 0
loc 32
rs 10
bpm 1
cpm 1
noi 2

1 Function

Rating   Name   Duplication   Size   Complexity  
A reference.js ➔ describe(ꞌcmsReferenceꞌ) 0 22 1
1
var chai = require('chai');
2
var path = require('path')
3
4
var config = require('../src/cli').config
5
config.set({root: __dirname + '/fixtures'})
0 ignored issues
show
Compatibility introduced by
Consider using the path module for constructing paths since they are otherwise not cross-OS compatible.
Loading history...
6
7
var cmsReference = require('../src/cli').cmsReference;
8
9
var jsonPath = 'test.json';
10
11
describe('cmsReference', function() {
12
  /**
13
   * cmsReference.reference.getFiles
14
   * 
15
   */
16
  it('cmsReference.reference.getFiles()', function() {
17
    var json = cmsReference.reference.getFiles();
18
    chai.expect(json).to.be.an('object');
19
    chai.expect(json[jsonPath].ref1).to.equal('ref1');
20
  });
21
22
  /**
23
   * cmsReference.reference.saveFile
24
   * 
25
   */
26
  it('cmsReference.reference.saveFile()', function() {
27
  	var json = cmsReference.reference.getFiles();
28
    var ref1 = json[jsonPath]['ref1'];
0 ignored issues
show
Unused Code introduced by
The variable ref1 seems to be never used. Consider removing it.
Loading history...
29
    cmsReference.reference.saveFile(jsonPath, JSON.stringify(json[jsonPath]));
30
    chai.expect(json[jsonPath]['ref1']).to.equal('ref1');
31
  });
32
});
33