Created
April 24, 2015 19:11
-
-
Save BrennanRoberts/f71a815cbeb5e927635d to your computer and use it in GitHub Desktop.
Mocha - Exceptions outside tests are silent when using --delay flag
This file contains hidden or 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
| setTimeout(function() { | |
| require('./some-test'); | |
| run(); | |
| }, 100); |
This file contains hidden or 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
| brennan@maru:~/code/mocha-requirejs-silent-errors$ cat package.json | |
| { | |
| "name": "mocha-silent-exception-sample", | |
| "version": "1.0.0", | |
| "devDependencies": { | |
| "mocha": "2.2.4" | |
| }, | |
| "scripts": { | |
| "test": "mocha --delay index.js" | |
| } | |
| } | |
This file contains hidden or 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
| throw new Error('boom'); | |
| console.log('loaded "dep"'); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run
npm testand notice that no exception is thrown.