Skip to content

armgit / mocha

Public Imported from GitHub
0

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

windows support for watcher SIGINT

Craig Taubde88088debb6
diff --git a/bin/_mocha b/bin/_mocha
index 7e84a3e5..dcaca6af 100755
--- a/bin/_mocha
+++ b/bin/_mocha
@@ -563,6 +563,16 @@ let rerun;
if (program.watch) {
console.log();
hideCursor();
+ if (process.platform === 'win32') {
+ // Windows support
+ var rl = require('readline').createInterface({
+ input: process.stdin,
+ output: process.stdout
+ });
+ rl.on('SIGINT', function() {
+ process.emit('SIGINT');
+ });
+ }
process.on('SIGINT', () => {
showCursor();
console.log('\n');