Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

modify --watch option: continue when SyntaxError

eiji.ienaga0ef058389440
diff --git a/bin/_mocha b/bin/_mocha
index 735d009a..b04a6e81 100755
--- a/bin/_mocha
+++ b/bin/_mocha
@@ -308,10 +308,14 @@ if (program.watch) {
var watchFiles = utils.files(cwd);
function loadAndRun() {
- mocha.files = files;
- mocha.run(function(){
- play(frames);
- });
+ try {
+ mocha.files = files;
+ mocha.run(function(){
+ play(frames);
+ });
+ } catch(e) {
+ process.stdout.write(e.stack);
+ }
}
function purge() {