mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
c24a73d23c
PR-URL: https://github.com/nodejs/node/pull/14293 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
28 lines
713 B
JavaScript
28 lines
713 B
JavaScript
'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');
|