produces edited stack that starts with error name #699
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I realized I introduced an issue in my previous PR (#690). This is the fix.
The result of the issue is that assertion messages would be output twice. Below is the output of a failed test on a private repo of mine using jest. Jest was able to point to the right place in the code where the failed
.expect
happened, but the assertion message was duplicated.After some digging, I realized that the new stack being built started with
error.message
, and it should really start witherror.toString()
. See the real-life example below. The error stack starts withError:
and then it continues with its.message
.I verified this code against tests running in another repo and displays assertion messages correctly. As far as I could test, only jest was impacted, but I would not be surprised that this impacts mocha and others, too.
Again, I'm so sorry about this. @niftylettuce, can you please review this and release a patch version? Thank you.