Skip to content

Commit

Permalink
Merge pull request #776 from yhwh/fix-error
Browse files Browse the repository at this point in the history
fix: launcher kill method which was throwing an error if no callback was...
  • Loading branch information
vojtajina committed Oct 18, 2013
2 parents 0ada450 + 5439f1c commit ee8303c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ var Launcher = function(emitter, injector) {
}
}

process.nextTick(callback);
if (callback) {
process.nextTick(callback);
}
return false;
};

Expand Down
7 changes: 7 additions & 0 deletions test/unit/launcher.spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ describe 'launcher', ->
expect(l.kill 'weid-id', done).to.equal false
expect(browser.kill).not.to.have.been.called

it 'should not resolve callback if none was defined', (done) ->
l.launch ['Fake']
browser = FakeBrowser._instances.pop()

expect(l.kill 'weid-id').to.equal false
process.nextTick ->
done()

describe 'killAll', ->
exitSpy = null
Expand Down

0 comments on commit ee8303c

Please sign in to comment.