-
Notifications
You must be signed in to change notification settings - Fork 109
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
rejectedWith
never asserts when given wrong type (boolean)
#186
Comments
Can you edit your example to be in JavaScript? I'm not interested in debugging other languages. |
@domenic I have updated my initial comment. Please let me know if I need to change anything else. Thanks in advance! |
Firstly, I'm not sure of the intent of your code, but you should absolutely be rejecting with only Secondly, the reason this is not working correctly is because For a fix to this, I suggest we ensure that |
rejectedWith
with boolean valuesrejectedWith
never asserts when given wrong type (boolean)
I was not aware of this. Thanks for the explanation on this ticket! |
@keithamus Thanks so much for your help here and for digging into things. Does Chai throw such an error if you pass it a boolean to |
@domenic Short answer: no. Longer answer: right now there is virtually no type checking inside chai. We are slowly doing this, and hopefully this will hopefully change to be enforced in future (see chaijs/chai#585). We can put this as a ticket in Chai to get it in for Chai@4 if you'd like us to fall in line with this plugin. |
Hey there,
I am experiencing an odd behavior when checking promise rejection. It seems, that the rejected boolean value is simply ignored. I would expect three failing test cases including the
rejects as promised (boolean)
one but I get only two. (Please see console output below). Maybe I am doing something wrong. Probably, one can easily spot the problem. I look forward to any kind of feedbacks. Cheers.Here is my setup:
/src/foo.spec.js
:test/mocha.opts
:package.json
:Console output when running the tests:
The text was updated successfully, but these errors were encountered: