-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Improve chai support (with detailed output, to match jest exceptions) #8152
Comments
I'm not sure what you're asking for? What would you want the output to look like? |
Sorry, I was in a rush, and so picked probably one of the worse examples - I've updated the issue description :) Ultimately I think what I'm asking for could be summed up as
|
I don't think we should add support for chai into jest, but the |
Totally, that's what I figured! Just wanted to make sure these points were written up somewhere so they could be referenced and included when said proposal gets implemented :D |
@G-Rath Thanks for reporting. Filed as https://youtrack.jetbrains.com/issue/WEB-37940. ETA is IntelliJ 2019.1.2, the fix will require |
Yeah, we'll probably serialize every prop on the thrown error when we fix it, so |
@SimenB , |
Yes please! PR very much welcome :) |
(waiting for upstream chaijs/chai#1257 for even better integration, but I think this is solved from Jest's side) |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
π Feature Proposal
A clear and concise description of what the feature is.
When using jest matchers, we get nice output:
If I use
chai#expect
matchers:When I run the same chai test in mocha:
From my understanding, the issue lies with Jest not taking any advantage of information provided by Chai, as
Chai
exposes expected & received information as part of the thrown assertion error, meaning it's on the testing system to utilise that information.Personally, this is the biggest showstopper for me switching to Jest :)
In addition, WebStorm shows a diff for some Jest matches, but not for chai matchers (whereas it does show a diff for chai in mocha, as evident in my previous screenshot).
I'm not sure what's required for this to be supported, but figure its related to the way Jest formats its output? (@segrey it'd be great if you could provide any info on this, if possible).
My efforts right now are hampered somewhat by #8118, so I can't be sure of how functional my test suites are right now π
The text was updated successfully, but these errors were encountered: