Open adelespinasse opened 7 years ago
I got it to behave correctly by removing the override (directly editing the override in my package.json) and installing diff with jspm install --dev npm:diff
. No idea why that override exists.
I don't have enough confidence about jspm configuration to submit a pull request.
See also #1022.
Oh, I later noticed that this is a problem with the exceptions thrown by Chai, but not by Unexpected, and not if the test simply does something like throw new Error('error')
. Possibly this is why @guybedford didn't notice the issue when writing the Mocha overrides and/or this article. I guess Mocha has special handling for Chai's exceptions.
Honestly I know little about test frameworks such as mocha, chai, and sinon. Instead I use tape + jspm run test/index
whenever I can because I like for to test frameworks to be simple and I dislike when they encourage mutating steps.
Thanks for linking that article here, it is indeed a great read and was a pleasure to read again.
The overrides file for Mocha includes
which I think is probably why it behaves strangely when a test fails:
Mocha is trying to use
diff
to format its output for the failure (I assume), butdiff
is empty because of the override. Is this override needed for something?