node/test/sequential/test-debugger-debug-brk.js
cjihrig ff1efa6087 test: use const for all require() calls
PR-URL: https://github.com/nodejs/node/pull/10550
Reviewed-By: Rich Trott <rtrott@gmail.com>
2017-01-02 18:28:18 -05:00

29 lines
622 B
JavaScript

'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');