-
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
For rejected promises that were expected to be fulfilled, log the error that was thrown #128
Comments
(@domenic this looks to be the same kind of issue as chaijs/sinon-chai#67). From a quick glance, I think we could get this diffing properly by just passing |
@keithamus I tried that locally - passing in true for the function assertIfNegated(assertion, message, extra) {
assertion.assert(true, null, message, extra.expected, extra.actual, true);
}
function assertIfNotNegated(assertion, message, extra) {
assertion.assert(false, message, null, extra.expected, extra.actual, true);
} I also noticed that |
@JaKXz it's worth reading chaijs/sinon-chai#67 as it offers a bit more context about the |
I also have this problem using cucumber.js. During testing to see if it was cucumber.js or chai-as-promised, I had two test cases: In one test case, I simply returned a rejected promise to cucumber.js with an Error instance. This was automatically printed to the output using the toString() method of the error instance, which I verified was called on my error instance by overriding its toString. Which is what I want, the full output of the error. In the other test case, I used chai-as-promised like so: |
I'm rolling up all bugs in the category "isRejected/rejectedWith doesn't behave like Chai's error rejectors" into #166. |
It would be great if those printed the entire error object, just like when I add the catch block to my code to debug:
Apologies if this has been discussed already / is implemented and I just can't find it on the docs.
The text was updated successfully, but these errors were encountered: