Files
node/test/sequential/test-debugger-quit-after-exit.js
Filip Skokan d5958888cc test: deflake debugger PID attachment and cleanup
Wait for the target to finish starting before attaching the debugger.
Capture the CLI close event when it is spawned so quit() also completes
after an early exit, and terminate the target before awaiting cleanup.
Add a regression test for quitting an already exited CLI and remove the
Windows flaky entry.

Refs: https://github.com/nodejs/node/issues/63212
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66320
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-09-30 08:25:48 +00:00

13 lines
376 B
JavaScript

'use strict';
const common = require('../common');
common.skipIfInspectorDisabled();
const assert = require('assert');
const startCLI = require('../common/debugger');
(async () => {
const cli = startCLI(['--help'], [], {}, { randomPort: false });
await assert.rejects(cli.waitForPrompt(), /Child exited while waiting/);
await cli.quit();
})().then(common.mustCall());