Skip to content

Commit

Permalink
[scripts/mocha] run _mocha script when debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed May 16, 2017
1 parent 1cc8060 commit 0ea2646
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/mocha.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
require('mocha/bin/mocha');
require('../src/optimize/babel/register');
require('../test/scripts/run_mocha');
16 changes: 16 additions & 0 deletions test/scripts/run_mocha.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const debugInBand = process.execArgv.some(arg => {
switch (arg) {
case '--debug':
case '--debug-brk':
case '-d':
case '--inspect':
return true;
}
});

if (debugInBand) {
process.argv.push('--no-timeouts');
require('mocha/bin/_mocha');
} else {
require('mocha/bin/mocha');
}

0 comments on commit 0ea2646

Please sign in to comment.