Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve assertion messages in uncaught exceptions
Wrap all assert.* methods in a try/catch that appends the current test to the Error object and rethrows. This allows us to get the corresponding Test object in the `uncaughtException` event. Before: uncaught undefined: AssertionError: 'blah' === 'blahs' at Blah.<anonymous> (/home/user/test.js:15:17) ... After: test.js testing blah(): AssertionError: 'blah' === 'blahs' at Blah.<anonymous> (/home/user/test.js:15:17) ...
- Loading branch information
1 parent
665f47c
commit fc43ba6
Showing
2 changed files
with
29 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters