Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support node's --debug-brk=1234 syntax to have debugger listen on specif... #852

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/_mocha
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ program
.option('-b, --bail', "bail after first test failure")
.option('-A, --async-only', "force all tests to take a callback (async)")
.option('--recursive', 'include sub directories')
.option('--debug-brk', "enable node's debugger breaking on the first line")
.option('--debug-brk', "enable node's debugger breaking on the first line. --debug-brk=<port> to debug on alternate port.")
.option('--globals <names>', 'allow the given comma-delimited global [names]', list, [])
.option('--check-leaks', 'check for global variable leaks')
.option('--interfaces', 'display available interfaces')
Expand Down
4 changes: 4 additions & 0 deletions bin/mocha
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ process.argv.slice(2).forEach(function (arg) {
else args.push(arg);
break;
}
//support --debug-brk=1234
if (/^--debug-brk(=\d+)?$/.test(arg)) {
args.unshift(arg);
}
});

var proc = spawn(process.argv[0], args, { customFds: [0,1,2] });
Expand Down