Skip to content

Commit ffcb044

Browse files
JPeer264phated
authored andcommitted
Fix: Inline anonymous functions to get tests passing on newer nodes (#70)
1 parent e2b2869 commit ffcb044

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

test/task.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('task', function() {
4040

4141
it('should throw on register an anonymous function without string name', function(done) {
4242
function noName() {
43-
taker.task(anon);
43+
taker.task(function() {});
4444
}
4545

4646
expect(noName).toThrow('Task name must be specified');

test/tree.js

+14-10
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,12 @@ describe('tree', function() {
8686
});
8787

8888
it('should form a 3 level nested tree', function(done) {
89-
var anon = function(cb) {
89+
taker.task('fn1', taker.parallel(function(cb) {
9090
cb();
91-
};
92-
taker.task('fn1', taker.parallel(anon, noop));
93-
taker.task('fn2', taker.parallel(anon, noop));
91+
}, noop));
92+
taker.task('fn2', taker.parallel(function(cb) {
93+
cb();
94+
}, noop));
9495
taker.task('fn3', taker.series('fn1', 'fn2'));
9596

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

118119
it('should use the proper labels for aliased tasks (nested)', function(done) {
119-
var anon = function(cb) {
120-
cb();
121-
};
122120
taker.task(noop);
123121
taker.task('fn1', noop);
124122
taker.task('fn2', taker.task('noop'));
125-
taker.task('fn3', anon);
126-
taker.task('ser', taker.series(noop, anon, 'fn1', 'fn2', 'fn3'));
127-
taker.task('par', taker.parallel(noop, anon, 'fn1', 'fn2', 'fn3'));
123+
taker.task('fn3', function(cb) {
124+
cb();
125+
});
126+
taker.task('ser', taker.series(noop, function(cb) {
127+
cb();
128+
}, 'fn1', 'fn2', 'fn3'));
129+
taker.task('par', taker.parallel(noop, function(cb) {
130+
cb();
131+
}, 'fn1', 'fn2', 'fn3'));
128132

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

0 commit comments

Comments
 (0)