-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Format chai.js exceptions so to display a better diff #386
Comments
This is an annoying on-purpose issue in Chai. They decided to go for a flexible "DYI" solution with "nice short messages" by default but in the end it makes it pretty cumbersome to output complete error messages. It is particularly difficult to reconstruct the error message with the full array data in it. #421 is an experimental approach to fix this. |
hey @charlierudolph , I'm still seeing the same issue as linked above ^^ |
Where exactly are you seeing that message? Most formatters (aside from json / event protocol) should be giving an error message with a diff |
I'm seeing it within my cucumber report, or if I wrap the expect in a catch and log out that result. my step definition function is as follows:
I've tried using the same.members in chai too but they both return back the same result. Any thoughts? or could you point me towards an array comparison in the examples? |
I'm seeing this too. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I'm using chai.js to make assertions. Unfortunately, when I compare arrays, I have a poor result because Cucumber doesn't format Chai exceptions like other test runners such as mocha.js or wallaby.js.
For instance, when I compare two big arrays:
I get:
Mocha, in this case would produce something like:
To be honest, this is annoying for big arrays only, because otherwise Chai produce a better exception message; see issue chaijs/chai#469.
The text was updated successfully, but these errors were encountered: