node/test/sequential/test-debugger-debug-brk.js
Daniel Bevenius 1402fef098 test: make tests pass when configured without-ssl
Currently when node is build --without-ssl and the test are run,
there are a number of failing test due to tests expecting crypto
support to be available. This commit fixes fixes the failure and
instead skips the tests that expect crypto to be available.

PR-URL: https://github.com/nodejs/node/pull/11631
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-03-04 20:16:52 +01:00

32 lines
711 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 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');