Skip to content

Commit

Permalink
Merge pull request #25 from plievone/start-array
Browse files Browse the repository at this point in the history
Fix `.start(array)`
  • Loading branch information
robrich committed Feb 24, 2014
2 parents fa3b282 + f02face commit 47c6770
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ util.inherits(Orchestrator, EventEmitter);
if (typeof arg === 'string') {
names.push(arg);
} else if (Array.isArray(arg)) {
names.concat(arg); // FRAGILE: ASSUME: it's an array of strings
names = names.concat(arg); // FRAGILE: ASSUME: it's an array of strings
} else {
throw new Error('pass strings or arrays of strings');
}
Expand Down
6 changes: 5 additions & 1 deletion test/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('orchestrator', function() {
});

it('should run multiple tasks as array', function(done) {
var orchestrator, a, fn, fn2;
var orchestrator, a, fn, fn2, fn3;

// Arrange
orchestrator = new Orchestrator();
Expand All @@ -45,8 +45,12 @@ describe('orchestrator', function() {
fn2 = function() {
++a;
};
fn3 = function() {
throw new Error('run wrong task');
};
orchestrator.add('test', fn);
orchestrator.add('test2', fn2);
orchestrator.add('test3', fn3);

// Act
orchestrator.start(['test', 'test2']);
Expand Down

1 comment on commit 47c6770

@nchabra
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, would it possible to push that fix to the node registry? I'm hitting that bug with Gulp and it is causing some nasty infinite loop with one on my watch.
Thanks

Please sign in to comment.