Skip to content

Commit 6699359

Browse files
committed
test: fix test failing due to difference in terminal codes
1 parent 1cc6e4e commit 6699359

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/parallel/test-repl-load-multiline.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ const repl = require('repl');
88
common.skipIfDumbTerminal();
99

1010
const command = `.load ${fixtures.path('repl-load-multiline.js')}`;
11-
const terminalCode = '\u001b[1G\u001b[0J \u001b[1G';
12-
const terminalCodeRegex = new RegExp(terminalCode.replace(/\[/g, '\\['), 'g');
11+
12+
// \u001b[nG - Move the cursor to nth column.
13+
// \u001b[0J - Clear from cursor to end of screen.
14+
/* eslint-disable-next-line no-control-regex */
15+
const terminalCodeRegex = /(\u001b\[0J|\u001b\[\d+G) ?/g;
1316

1417
const expected = `${command}
1518
const getLunch = () =>

0 commit comments

Comments
 (0)