Skip to content

Commit

Permalink
Use debug-brk and reqContinue + forcefully exit if debug option is used.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kami committed Jun 14, 2011
1 parent 58310ed commit abf6b5e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ TestRunner.prototype._spawnTestProcess = function(filePath,
var args = [];

if (this._debug) {
args.push('--debug=' + port);
args.push('--debug-brk=' + port);
}

args = args.concat([runFilePath, filePath, this._socketPath, cwd, libCovDir,
Expand All @@ -202,7 +202,9 @@ TestRunner.prototype._spawnTestProcess = function(filePath,

if (this._debug) {
var debuggerInterface = new DebuggerInterface();
debuggerInterface.connect(port, 400);
debuggerInterface.connect(port, 400, function(err, client) {
client.reqContinue();
});
}

return child;
Expand All @@ -229,11 +231,11 @@ TestRunner.prototype._handleTestsCompleted = function() {
this._coverageReporter.handleTestsComplete();
}

exitCode = statusCode;

if (this._debug) {
process.stdin.destroy();
process.exit();
}

exitCode = statusCode;
}
};

Expand Down

0 comments on commit abf6b5e

Please sign in to comment.