forked from gulpjs/gulp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtaskTree.js
More file actions
42 lines (36 loc) · 731 Bytes
/
taskTree.js
File metadata and controls
42 lines (36 loc) · 731 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
'use strict';
var taskTree = require('../lib/taskTree');
var should = require('should');
require('mocha');
describe('taskTree()', function() {
it('should form a tree properly', function(done) {
should.exist(taskTree); // Lol shutup jshint
var tasks = {
test: {
dep: ['abc', 'def'],
},
abc: {
dep: ['def'],
},
def: {
dep: [],
},
};
var expectTree = {
nodes: [
{
label: 'test',
nodes: ['abc', 'def'],
}, {
label: 'abc',
nodes: ['def'],
}, {
label: 'def',
nodes: [],
},
],
};
taskTree(tasks).should.eql(expectTree);
done();
});
});