-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Unexpected throw in .throws()
#1439
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
Comments
You're throwing a string and not an Error object: https://github.com/StoneCypher/jssm/blob/6f22cc476a2a24476a10f6d5c8f75bead619f48e/src/js/jssm.js#L265 |
Oh. May I please recommend that the error message here point that out as a possibility? It would not have occurred to me that throwing a string wouldn't be caught by |
And/or should strings thrown be caught by |
You should use |
@kevva - sorry, no, |
this is not a duplicate of 661; the behavior is entirely different, and does not appear to be defective in presentation this is not a duplicate of 1047, which is about simplifying i wish this had not been closed, and generally it's polite to ask the person opening the ticket before closing i retain the belief that |
@StoneCypher It's because you specified it to expect an |
Thank you. |
You can replicate by pulling my repo and uncommenting the commented-out test.
Test Source
Error Message & Stack Trace
The exception is expected, and that is the correct exception message.
This test is a
.throws()
. I don't understand why this is treated as a failure. Near-verbatim identical tests cover my otherthrow
s and work as expected.Config
I do not configure Ava. No such block or .rc exists in my project.
Command-Line Arguments
My build is trivial.
Relevant Links
This is the repo.
Environment
Replicates under MacOS current and Windows 10 Pro current. Both tested under node 8 current.
Replicates on travis-ci under node-6, node-7, and node-8, all current, all under whatever linux they use.
All are using ava 0.20.0, installed as local node modules.
The text was updated successfully, but these errors were encountered: