mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
Run the debugger function-formatting checks against an auto-resumed, long-lived target so they do not depend on initial-break rendering. Use a synchronous VM evaluator for the REPL handleError test. Submit the throwing input separately and wait for clean REPL teardown. Signed-off-by: Matteo Collina <hello@matteocollina.com> PR-URL: https://github.com/nodejs/node/pull/64718 Refs: https://github.com/nodejs/node/actions/runs/30080039199/job/89439279468?pr=64339 Reviewed-By: Aviv Keller <me@aviv.sh> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
38 lines
1.3 KiB
JavaScript
38 lines
1.3 KiB
JavaScript
import { skipIfInspectorDisabled } from '../common/index.mjs';
|
|
|
|
skipIfInspectorDisabled();
|
|
|
|
import * as fixtures from '../common/fixtures.mjs';
|
|
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 });
|
|
|
|
try {
|
|
await cli.waitForPrompt();
|
|
await cli.command('exec a = function func() {}; a;');
|
|
assert.match(cli.output, /\[Function: func\]/);
|
|
await cli.command('exec a = function func () {}; a;');
|
|
assert.match(cli.output, /\[Function\]/);
|
|
await cli.command('exec a = function() {}; a;');
|
|
assert.match(cli.output, /\[Function: function\]/);
|
|
await cli.command('exec a = () => {}; a;');
|
|
assert.match(cli.output, /\[Function\]/);
|
|
await cli.command('exec a = function* func() {}; a;');
|
|
assert.match(cli.output, /\[GeneratorFunction: func\]/);
|
|
await cli.command('exec a = function *func() {}; a;');
|
|
assert.match(cli.output, /\[GeneratorFunction: \*func\]/);
|
|
await cli.command('exec a = function*func() {}; a;');
|
|
assert.match(cli.output, /\[GeneratorFunction: function\*func\]/);
|
|
await cli.command('exec a = function * func() {}; a;');
|
|
assert.match(cli.output, /\[GeneratorFunction\]/);
|
|
} finally {
|
|
cli.quit();
|
|
}
|