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.
|
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
common.skipIfInspectorDisabled();
|
|
|
|
const assert = require('assert');
|
|
|
|
const spawn = require('child_process').spawn;
|
|
|
|
|
|
|
|
const script = `${common.fixturesDir}/empty.js`;
|
|
|
|
|
|
|
|
function test(arg) {
|
|
|
|
const child = spawn(process.execPath, ['--inspect', arg, script]);
|
|
|
|
const argStr = child.spawnargs.join(' ');
|
|
|
|
const fail = () => assert.fail(true, false, `'${argStr}' should not quit`);
|
|
|
|
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');
|