current commit
260601.7 · debugger: add more logs to probe mode
// This tests that probe launch failures fail fast instead of timing out.
'use strict';

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

const assert = require('assert');
const fixtures = require('../common/fixtures');
const { spawnSyncAndExit } = require('../common/child_process');

const cwd = fixtures.path('debugger');

spawnSyncAndExit(process.execPath, [
  'inspect',
  '--probe', 'probe.js:12',
  '--expr', 'finalValue',
  '--',
  '--not-a-real-node-flag',
  'probe.js',
], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, {
  signal: null,
  status: 1,
  stderr(output) {
    assert.match(output, /bad option: --not-a-real-node-flag/);
    assert.match(output, /Target exited before the inspector was ready \(code 9\)/);
  },
  trim: true,
});