Skip to content

Commit

Permalink
Fix: Inline anonymous functions to get tests passing on newer nodes (#70
Browse files Browse the repository at this point in the history
)
  • Loading branch information
JPeer264 authored and phated committed Jan 25, 2017
1 parent e2b2869 commit ffcb044
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion test/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('task', function() {

it('should throw on register an anonymous function without string name', function(done) {
function noName() {
taker.task(anon);
taker.task(function() {});
}

expect(noName).toThrow('Task name must be specified');
Expand Down
24 changes: 14 additions & 10 deletions test/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,12 @@ describe('tree', function() {
});

it('should form a 3 level nested tree', function(done) {
var anon = function(cb) {
taker.task('fn1', taker.parallel(function(cb) {
cb();
};
taker.task('fn1', taker.parallel(anon, noop));
taker.task('fn2', taker.parallel(anon, noop));
}, noop));
taker.task('fn2', taker.parallel(function(cb) {
cb();
}, noop));
taker.task('fn3', taker.series('fn1', 'fn2'));

var tree = taker.tree({ deep: true });
Expand All @@ -116,15 +117,18 @@ describe('tree', function() {
});

it('should use the proper labels for aliased tasks (nested)', function(done) {
var anon = function(cb) {
cb();
};
taker.task(noop);
taker.task('fn1', noop);
taker.task('fn2', taker.task('noop'));
taker.task('fn3', anon);
taker.task('ser', taker.series(noop, anon, 'fn1', 'fn2', 'fn3'));
taker.task('par', taker.parallel(noop, anon, 'fn1', 'fn2', 'fn3'));
taker.task('fn3', function(cb) {
cb();
});
taker.task('ser', taker.series(noop, function(cb) {
cb();
}, 'fn1', 'fn2', 'fn3'));
taker.task('par', taker.parallel(noop, function(cb) {
cb();
}, 'fn1', 'fn2', 'fn3'));

var tree = taker.tree({ deep: true });

Expand Down

0 comments on commit ffcb044

Please sign in to comment.