Skip to content

Commit 6ccb15f

Browse files
pfaffetargos
authored andcommitted
test: adapt debugger tests to V8 11.4
Accept a new `step` break message. PR-URL: #49639 Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
1 parent fd21429 commit 6ccb15f

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

test/common/debugger.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const spawn = require('child_process').spawn;
44

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

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

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

133133
ctrlC() {

test/parallel/test-debugger-break.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const cli = startCLI(['--port=0', script]);
2727

2828
await cli.stepCommand('n');
2929
assert.ok(
30-
cli.output.includes(`break in ${script}:2`),
30+
cli.output.includes(`step in ${script}:2`),
3131
'pauses in next line of the script');
3232
assert.match(
3333
cli.output,
@@ -36,7 +36,7 @@ const cli = startCLI(['--port=0', script]);
3636

3737
await cli.stepCommand('next');
3838
assert.ok(
39-
cli.output.includes(`break in ${script}:3`),
39+
cli.output.includes(`step in ${script}:3`),
4040
'pauses in next line of the script');
4141
assert.match(
4242
cli.output,
@@ -89,7 +89,7 @@ const cli = startCLI(['--port=0', script]);
8989
await cli.stepCommand('');
9090
assert.match(
9191
cli.output,
92-
/break in node:timers/,
92+
/step in node:timers/,
9393
'entered timers.js');
9494

9595
await cli.stepCommand('cont');

test/parallel/test-debugger-run-after-quit-restart.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const path = require('path');
2525
.then(() => cli.stepCommand('n'))
2626
.then(() => {
2727
assert.ok(
28-
cli.output.includes(`break in ${script}:2`),
28+
cli.output.includes(`step in ${script}:2`),
2929
'steps to the 2nd line'
3030
);
3131
})

0 commit comments

Comments
 (0)