Completed
Push — master ( ba793d...d63ed2 )
by
unknown
04:42
created

file-attr.js ➔ ... ➔ before   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
nc 1
dl 0
loc 13
rs 9.4285
nop 1
1
var chai = require('chai');
2
3
var config = require('../src/cli').config
4
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...
5
6
var cmsData = require('../src/cli').cmsData;
7
var Manager = require('../src/cli').Manager;
8
var fse = require('fs-extra');
9
10
describe('fileAttr', function() {
11
  before( function(done) {
12
    Manager.instance.init()
13
      .then(function () {
14
        Manager.instance._whereKeys = ['title', 'priority', 'abe_meta', 'articles']
15
        Manager.instance.updateList()
16
17
        this.fixture = {
18
          jsonDraft: fse.readJsonSync(__dirname + '/fixtures/data/article-1-abe-d20160919T125255138Z.json')
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...
19
        }
20
        done()
21
        
22
      }.bind(this))
23
  });
24
  
25
  /**
26
   * cmsData.fileAttr.test
27
   * 
28
   */
29
  it('cmsData.fileAttr.test()', function() {
30
    var bool = cmsData.fileAttr.test(this.fixture.jsonDraft.abe_meta.latest.abeUrl)
31
    chai.expect(bool).to.be.true;
0 ignored issues
show
introduced by
The result of the property access to chai.expect(bool).to.be.true is not used.
Loading history...
32
    bool = cmsData.fileAttr.test(this.fixture.jsonDraft.abe_meta.link)
33
    chai.expect(bool).to.be.false;
0 ignored issues
show
introduced by
The result of the property access to chai.expect(bool).to.be.false is not used.
Loading history...
34
  });
35
36
  /**
37
   * cmsData.fileAttr.delete
38
   * 
39
   */
40
  it('cmsData.fileAttr.delete()', function() {
41
  	var str = cmsData.fileAttr.delete(this.fixture.jsonDraft.abe_meta.latest.abeUrl)
42
    var bool = cmsData.fileAttr.test(str)
43
    chai.expect(bool).to.be.false;
0 ignored issues
show
introduced by
The result of the property access to chai.expect(bool).to.be.false is not used.
Loading history...
44
  });
45
});
46