BufferedProcess::onDidThrowError -> ::onDidThrowError

This commit is contained in:
Ben Ogle
2014-12-10 18:08:43 -08:00
parent ad73902382
commit f2ab14656b
2 changed files with 24 additions and 12 deletions

View File

@@ -17,14 +17,15 @@ describe "BufferedProcess", ->
args: ['nothing']
options: {}
process.onDidThrowError errorSpy = jasmine.createSpy()
errorSpy = jasmine.createSpy().andCallFake (error) -> error.handle()
process.onWillThrowError(errorSpy)
waitsFor -> errorSpy.callCount > 0
runs ->
expect(window.onerror).not.toHaveBeenCalled()
expect(errorSpy).toHaveBeenCalled()
expect(errorSpy.mostRecentCall.args[0].message).toContain 'spawn bad-command-nope ENOENT'
expect(errorSpy.mostRecentCall.args[0].error.message).toContain 'spawn bad-command-nope ENOENT'
describe "when there is not an error handler specified", ->
it "calls the error handler and does not throw an exception", ->