Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests] Accept step break message #154

Merged
merged 1 commit into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/common/debugger.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const spawn = require('child_process').spawn;

const BREAK_MESSAGE = new RegExp('(?:' + [
'assert', 'break', 'break on start', 'debugCommand',
'exception', 'other', 'promiseRejection',
'exception', 'other', 'promiseRejection', 'step',
].join('|') + ') in', 'i');

let TIMEOUT = common.platformTimeout(5000);
Expand Down Expand Up @@ -121,13 +121,13 @@ function startCLI(args, flags = [], spawnOpts = {}) {
get breakInfo() {
const output = this.output;
const breakMatch =
output.match(/break (?:on start )?in ([^\n]+):(\d+)\n/i);
output.match(/(step |break (?:on start )?)in ([^\n]+):(\d+)\n/i);

if (breakMatch === null) {
throw new Error(
`Could not find breakpoint info in ${JSON.stringify(output)}`);
}
return { filename: breakMatch[1], line: +breakMatch[2] };
return { filename: breakMatch[2], line: +breakMatch[3] };
},

ctrlC() {
Expand Down
6 changes: 3 additions & 3 deletions test/sequential/test-debugger-break.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const cli = startCLI([script]);

await cli.stepCommand('n');
assert.ok(
cli.output.includes(`break in ${script}:2`),
cli.output.includes(`step in ${script}:2`),
'pauses in next line of the script');
assert.match(
cli.output,
Expand All @@ -36,7 +36,7 @@ const cli = startCLI([script]);

await cli.stepCommand('next');
assert.ok(
cli.output.includes(`break in ${script}:3`),
cli.output.includes(`step in ${script}:3`),
'pauses in next line of the script');
assert.match(
cli.output,
Expand Down Expand Up @@ -89,7 +89,7 @@ const cli = startCLI([script]);
await cli.stepCommand('');
assert.match(
cli.output,
/break in node:timers/,
/step in node:timers/,
'entered timers.js');

await cli.stepCommand('cont');
Expand Down
2 changes: 1 addition & 1 deletion test/sequential/test-debugger-run-after-quit-restart.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const path = require('path');
.then(() => cli.stepCommand('n'))
.then(() => {
assert.ok(
cli.output.includes(`break in ${script}:2`),
cli.output.includes(`step in ${script}:2`),
'steps to the 2nd line'
);
})
Expand Down