mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
673 B
30 lines
673 B
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const spawn = require('child_process').spawn;
|
|
|
|
var script = common.fixturesDir + '/empty.js';
|
|
|
|
function fail() {
|
|
assert(0); // `node --debug-brk script.js` should not quit
|
|
}
|
|
|
|
function test(arg) {
|
|
var child = spawn(process.execPath, [arg, script]);
|
|
child.on('exit', fail);
|
|
|
|
// give node time to start up the debugger
|
|
setTimeout(function() {
|
|
child.removeListener('exit', fail);
|
|
child.kill();
|
|
}, 2000);
|
|
|
|
process.on('exit', function() {
|
|
assert(child.killed);
|
|
});
|
|
}
|
|
|
|
test('--debug-brk');
|
|
test('--debug-brk=5959');
|
|
test('--inspect-brk');
|
|
test('--inspect-brk=9230');
|
|
|