From b262504bce6258efb8f25522d0b1a5a63aa01632 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Sat, 13 Dec 2025 18:53:50 +0000 Subject: [PATCH] test: remove unneccessary repl magic_mode tests --- test/parallel/test-repl-mode.js | 12 --------- test/parallel/test-repl-underscore.js | 38 --------------------------- 2 files changed, 50 deletions(-) diff --git a/test/parallel/test-repl-mode.js b/test/parallel/test-repl-mode.js index fbc9c18cba4998..3faa0a96d58799 100644 --- a/test/parallel/test-repl-mode.js +++ b/test/parallel/test-repl-mode.js @@ -11,7 +11,6 @@ if (process.env.TERM === 'dumb') { const tests = [ testSloppyMode, testStrictMode, - testAutoMode, testStrictModeTerminal, ]; @@ -56,14 +55,3 @@ function testStrictModeTerminal() { output.accumulator.includes('\n// ReferenceError: xyz is not defined') ); } - -function testAutoMode() { - const { input, output } = startNewREPLServer({ replMode: repl.REPL_MODE_MAGIC, terminal: false, prompt: '> ' }); - - input.emit('data', 'x = 3\n'); - assert.strictEqual(output.accumulator, '> 3\n> '); - output.accumulator = ''; - - input.emit('data', 'let y = 3\n'); - assert.strictEqual(output.accumulator, 'undefined\n> '); -} diff --git a/test/parallel/test-repl-underscore.js b/test/parallel/test-repl-underscore.js index 52d4cd86e94176..4c091a268fb701 100644 --- a/test/parallel/test-repl-underscore.js +++ b/test/parallel/test-repl-underscore.js @@ -9,7 +9,6 @@ const testingReplPrompt = '_REPL_TESTING_PROMPT_>'; testSloppyMode(); testStrictMode(); -testMagicMode(); testResetContext(); testResetContextGlobal(); testError(); @@ -86,46 +85,9 @@ function testStrictMode() { ]); } -function testMagicMode() { - const { replServer, output } = startNewREPLServer({ - prompt: testingReplPrompt, - mode: repl.REPL_MODE_MAGIC, - }); - - replServer.write(`_; // initial value undefined - x = 10; // - _; // last eval - 10 - let _ = 20; // undefined - _; // 20 from user input - _ = 30; // make sure we can set it twice and no prompt - _; // 30 from user input - var y = 40; // make sure eval doesn't change _ - _; // remains 30 from user input - function f() { let _ = 50; return _; } // undefined - f(); // 50 - _; // remains 30 from user input - `); - - assertOutput(output, [ - 'undefined', - '10', - '10', - 'undefined', - '20', - '30', - '30', - 'undefined', - '30', - 'undefined', - '50', - '30', - ]); -} - function testResetContext() { const { replServer, output } = startNewREPLServer({ prompt: testingReplPrompt, - mode: repl.REPL_MODE_MAGIC, }); replServer.write(`_ = 10; // explicitly set to 10