Completed
Push — master ( 7cb640...ba6ef7 )
by greg
01:21
created

sort.js ➔ ... ➔ it(ꞌcmsData.sort.byDateDescꞌ)   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 9.4285
1
var chai = require('chai');
2
var path = require('path');
3
var fse = require('fs-extra');
4
5
var config = require('../../../src/cli').config
6
config.set({root: path.join(process.cwd(), 'test', 'fixtures')})
7
8
var Manager = require('../../../src/cli').Manager;
9
var cmsData = require('../../../src/cli').cmsData
10
11
describe('Sort', function() {
12
  before( function(done) {
13
    Manager.instance.init()
14
      .then(function () {
15
        done()
16
        
17
      }.bind(this))
0 ignored issues
show
unused-code introduced by
The call to bind does not seem necessary since the function does not use this. Consider calling it directly.
Loading history...
18
  });
19
20
  /**
21
   * cmsData.sort.byDateAsc
22
   * 
23
   */
24
  it('cmsData.sort.byDateAsc', function() {
25
  	var list = Manager.instance.getList()
26
  	list.sort(cmsData.sort.byDateAsc)
27
  	chai.expect(list[0].name).to.contain('article-1');
28
  });
29
30
  /**
31
   * cmsData.sort.byDateDesc
32
   * 
33
   */
34
  it('cmsData.sort.byDateDesc', function() {
35
  	var list = Manager.instance.getList()
36
  	list.sort(cmsData.sort.byDateDesc)
37
  	chai.expect(list[0].name).to.contain('article');
38
  });
39
});
40