Skip to content

Commit

Permalink
Update: Import task tree test from gulp
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Dec 21, 2017
1 parent 8399e11 commit 1994070
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions test/taskTree.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
'use strict';

var lab = exports.lab = require('lab').script();
var code = require('code');

var taskTree = require('../lib/taskTree');

lab.experiment('taskTree()', function() {

lab.test('forms a tree properly', function(done) {
code.expect(taskTree).to.exist(); // 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: []
}]
};

code.expect(taskTree(tasks)).to.deep.equal(expectTree);
done();
});
});

0 comments on commit 1994070

Please sign in to comment.