Skip to content

armgit / mocha

Public Imported from GitHub
0

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

Fixed node-inspector support, swapped `--debug` for `debug` to match node. Closes #247

TJ Holowaychuk41e41187b5db
diff --git a/bin/_mocha b/bin/_mocha
index 260b1ab7..917788fd 100755
--- a/bin/_mocha
+++ b/bin/_mocha
@@ -39,7 +39,7 @@ var images = {
program
.version(mocha.version)
- .usage('[options] [files]')
+ .usage('[debug] [options] [files]')
.option('-r, --require <name>', 'require the given module')
.option('-R, --reporter <name>', 'specify the reporter to use', 'dot')
.option('-u, --ui <name>', 'specify user-interface (bdd|tdd|exports)', 'bdd')
@@ -50,8 +50,9 @@ program
.option('-c, --colors', 'force enabling of colors')
.option('-C, --no-colors', 'force disabling of colors')
.option('-G, --growl', 'enable growl notification support')
- .option('-d, --debug', "enable node's debugger")
+ .option('-d, --debug', "enable node's debugger, synonym for node --debug")
.option('-b, --bail', "bail after first test failure")
+ .option('--debug-brk', "enable node's debugger breaking on the first line")
.option('--globals <names>', 'allow the given comma-delimited global [names]', list, [])
.option('--ignore-leaks', 'ignore global variable leaks')
.option('--interfaces', 'display available interfaces')
diff --git a/bin/mocha b/bin/mocha
index 4cbbac4a..811ed9d8 100755
--- a/bin/mocha
+++ b/bin/mocha
@@ -11,8 +11,12 @@ var spawn = require('child_process').spawn
process.argv.slice(2).forEach(function (arg) {
switch (arg) {
case '-d':
+ args.unshift('--debug');
+ break;
+ case 'debug':
case '--debug':
- args.unshift('debug');
+ case '--debug-brk':
+ args.unshift(arg);
break;
case '-gc':
case '--expose-gc':