Your IP : 216.73.216.48


Current Path : /hdd/hdd12/install/nodejs/node-13.6.0/test/sequential/
Upload File :
Current File : //hdd/hdd12/install/nodejs/node-13.6.0/test/sequential/test-inspector-enabled.js

'use strict';
const common = require('../common');
common.skipIfInspectorDisabled();

const spawn = require('child_process').spawn;

const script = `
const assert = require('assert');
const inspector = process.binding('inspector');

assert(
  !!inspector.isEnabled(),
  'inspector.isEnabled() should be true when run with --inspect');

process._debugEnd();

assert(
  !inspector.isEnabled(),
  'inspector.isEnabled() should be false after _debugEnd()');
`;

const args = ['--inspect', '-e', script];
const child = spawn(process.execPath, args, {
  stdio: 'inherit',
  env: { ...process.env, NODE_V8_COVERAGE: '' }
});
child.on('exit', (code, signal) => {
  process.exit(code || signal);
});