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

test/sort.js   A

Complexity

Total Complexity 4
Complexity/F 1

Size

Lines of Code 29
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

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

1 Function

Rating   Name   Duplication   Size   Complexity  
A sort.js ➔ describe(ꞌSortꞌ) 0 19 1
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(__dirname,'fixtures')})
7
8
var Manager = require('../src/cli').Manager;
9
var coreUtils = require('../src/cli').coreUtils
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
   * coreUtils.sort.shuffle
22
   * 
23
   */
24
  it('coreUtils.sort.shuffle', function() {
25
  	var list = Manager.instance.getList()
26
  	var shuffled = coreUtils.sort.shuffle(list)
27
  	chai.expect(shuffled[0].name).to.be.oneOf(['article-2.json', 'article-1.json', 'homepage-1.json']);
28
  });
29
});
30