blob: f5a69b91d6b5363698f8cc0bd85cb0723a715960 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
'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 fail() {
assert(0); // `node --debug-brk script.js` should not quit
}
function test(arg) {
const 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');
|