Skip to content

Commit

Permalink
test: fix test failing due to difference in terminal codes
Browse files Browse the repository at this point in the history
  • Loading branch information
Theo-Steiner committed Mar 1, 2023
1 parent 1cc6e4e commit 6699359
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/parallel/test-repl-load-multiline.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ const repl = require('repl');
common.skipIfDumbTerminal();

const command = `.load ${fixtures.path('repl-load-multiline.js')}`;
const terminalCode = '\u001b[1G\u001b[0J \u001b[1G';
const terminalCodeRegex = new RegExp(terminalCode.replace(/\[/g, '\\['), 'g');

// \u001b[nG - Move the cursor to nth column.
// \u001b[0J - Clear from cursor to end of screen.
/* eslint-disable-next-line no-control-regex */
const terminalCodeRegex = /(\u001b\[0J|\u001b\[\d+G) ?/g;

const expected = `${command}
const getLunch = () =>
Expand Down

0 comments on commit 6699359

Please sign in to comment.