From 84cf4668ee906bdc91d5ed717898722773eabfa4 Mon Sep 17 00:00:00 2001 From: Aviv Keller Date: Mon, 23 Sep 2024 16:38:53 -0400 Subject: [PATCH] fixup! Co-authored-by: Antoine du Hamel --- test/parallel/test-repl-preview-newlines.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-repl-preview-newlines.js b/test/parallel/test-repl-preview-newlines.js index b607faa2fd6c46..a0055b46fe2c2c 100644 --- a/test/parallel/test-repl-preview-newlines.js +++ b/test/parallel/test-repl-preview-newlines.js @@ -20,12 +20,10 @@ repl.start({ let output = ''; outputStream.write = (chunk) => output += chunk; -const testChars = ['\\n', '\\v', '\\r']; - -for (const test of testChars) { - inputStream.emit('data', `"${test}"()`); +for (const testChar of '\n\v\r') { + inputStream.emit('data', `${JSON.stringify(testChar)}()`); // Make sure the output is on a single line - assert.strictEqual(output, `"${test}"()\n\x1B[90mTypeError: "\x1B[39m\x1B[9G\x1B[1A`); + assert.strictEqual(output, `${JSON.stringify(testChar)}()\n\x1B[90mTypeError: "\x1B[39m\x1B[9G\x1B[1A`); inputStream.run(['']); output = ''; }