Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ospec-the-library should throw rather than call process.exit(1) #1782

Closed
pygy opened this issue Apr 6, 2017 · 2 comments
Closed

ospec-the-library should throw rather than call process.exit(1) #1782

pygy opened this issue Apr 6, 2017 · 2 comments
Assignees
Labels
Type: Enhancement For any feature request or suggestion that isn't a bug fix

Comments

@pygy
Copy link
Member

pygy commented Apr 6, 2017

https://gitter.im/lhorie/mithril.js?at=58e4dfe48bb56c2d11797f22

This was raised by @vladpazych on gitter:

Hello everybody.
I am trying to setup ospec for tdd, but when at least one test fails - my test server exits.
Is it expected behaviour?
I do something like this:
watch(path.resolve('./test/unit'), { recursive: true }, function () {

 var _o = o.new()
 _o('addition', () => {
   _o(1 + 1).equals(2)
 })
 _o.run()
})

I tried to catch _o.run(), but there is no exception. It just stops server.

We could have ospec-the-binary call process.exit(1) instead if ospec-the-library throws

@pygy pygy added the Type: Enhancement For any feature request or suggestion that isn't a bug fix label Apr 6, 2017
@pygy pygy self-assigned this May 8, 2017
@dead-claudia
Copy link
Member

Better: process.exitCode = 1 from the binary, and invoke an error-first callback when done.

@pygy pygy added the ospec label Nov 29, 2017
@pygy
Copy link
Member Author

pygy commented Nov 29, 2017

Fixed by #2020

@pygy pygy closed this as completed Nov 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement For any feature request or suggestion that isn't a bug fix
Projects
None yet
Development

No branches or pull requests

2 participants