2017-05-29 11:28:01 +08:00
|
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
common.skipIfInspectorDisabled();
|
2017-10-07 02:23:37 +08:00
|
|
|
|
2019-01-31 03:29:30 +08:00
|
|
|
// This test ensures that the --debug-brk flag will exit the process
|
2017-05-29 11:28:01 +08:00
|
|
|
const assert = require('assert');
|
2017-10-07 02:23:37 +08:00
|
|
|
const fixtures = require('../common/fixtures');
|
2019-01-31 03:29:30 +08:00
|
|
|
const { spawnSync } = require('child_process');
|
2017-05-29 11:28:01 +08:00
|
|
|
|
2019-01-31 03:29:30 +08:00
|
|
|
// File name here doesn't actually matter the process will exit on start.
|
2017-10-07 01:11:02 +08:00
|
|
|
const script = fixtures.path('empty.js');
|
2017-05-29 11:28:01 +08:00
|
|
|
|
|
|
|
function test(arg) {
|
2019-01-31 03:29:30 +08:00
|
|
|
const child = spawnSync(process.execPath, ['--inspect', arg, script]);
|
|
|
|
const stderr = child.stderr.toString();
|
|
|
|
assert(stderr.includes('DEP0062'));
|
|
|
|
assert.strictEqual(child.status, 9);
|
2017-05-29 11:28:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
test('--debug-brk');
|
|
|
|
test('--debug-brk=5959');
|