Skip to content

Instantly share code, notes, and snippets.

@BrennanRoberts
Created April 24, 2015 19:11
Show Gist options
  • Save BrennanRoberts/f71a815cbeb5e927635d to your computer and use it in GitHub Desktop.
Save BrennanRoberts/f71a815cbeb5e927635d to your computer and use it in GitHub Desktop.
Mocha - Exceptions outside tests are silent when using --delay flag
setTimeout(function() {
require('./some-test');
run();
}, 100);
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"
}
}
throw new Error('boom');
console.log('loaded "dep"');
@BrennanRoberts
Copy link
Author

Run npm test and notice that no exception is thrown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment