diff --git a/test/parallel/test-debugger-extract-function-name.mjs b/test/parallel/test-debugger-extract-function-name.mjs index b787750453f..1635dde7358 100644 --- a/test/parallel/test-debugger-extract-function-name.mjs +++ b/test/parallel/test-debugger-extract-function-name.mjs @@ -7,14 +7,12 @@ import startCLI from '../common/debugger.js'; import assert from 'assert'; -const env = { - ...process.env, - NODE_INSPECT_RESUME_ON_START: '1', -}; -const cli = startCLI( - [fixtures.path('debugger', 'alive.js')], [], { env }); +// Evaluating while the target is running can trigger a V8 scope assertion. +// Keep it paused for these formatting checks. +const cli = startCLI([fixtures.path('debugger', 'three-lines.js')]); try { + await cli.waitForInitialBreak(); await cli.waitForPrompt(); await cli.command('exec a = function func() {}; a;'); assert.match(cli.output, /\[Function: func\]/); @@ -33,5 +31,5 @@ try { await cli.command('exec a = function * func() {}; a;'); assert.match(cli.output, /\[GeneratorFunction\]/); } finally { - cli.quit(); + await cli.quit(); }