Skip to content

armgit / mocha

Public Imported from GitHub
0

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

Merge pull request #1100 from benjie/watch-abort

Travis Jeffery68ae2d869b6e
diff --cc bin/_mocha
index d5aeaff5,950836f4..bea6df85
--- a/bin/_mocha
+++ b/bin/_mocha
@@@ -328,9 -336,17 +336,18 @@@ if (program.watch)
purge();
stop()
mocha.suite = mocha.suite.clone();
+ mocha.suite.ctx = new Mocha.Context;
mocha.ui(program.ui);
loadAndRun();
+ }
+
+ utils.watch(watchFiles, function(){
+ runAgain = true;
+ if (runner) {
+ runner.abort();
+ } else {
+ rerun();
+ }
});
return;