test: remove unneccessary repl magic_mode tests · nodejs/node@f2706e1

2 files changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -11,7 +11,6 @@ if (process.env.TERM === 'dumb') {

1111

const tests = [

1212

testSloppyMode,

1313

testStrictMode,

14-

testAutoMode,

1514

testStrictModeTerminal,

1615

];

1716

@@ -56,14 +55,3 @@ function testStrictModeTerminal() {

5655

output.accumulator.includes('\n// ReferenceError: xyz is not defined')

5756

);

5857

}

59-
60-

function testAutoMode() {

61-

const { input, output } = startNewREPLServer({ replMode: repl.REPL_MODE_MAGIC, terminal: false, prompt: '> ' });

62-
63-

input.emit('data', 'x = 3\n');

64-

assert.strictEqual(output.accumulator, '> 3\n> ');

65-

output.accumulator = '';

66-
67-

input.emit('data', 'let y = 3\n');

68-

assert.strictEqual(output.accumulator, 'undefined\n> ');

69-

}

Original file line numberDiff line numberDiff line change

@@ -9,7 +9,6 @@ const testingReplPrompt = '_REPL_TESTING_PROMPT_>';

99
1010

testSloppyMode();

1111

testStrictMode();

12-

testMagicMode();

1312

testResetContext();

1413

testResetContextGlobal();

1514

testError();

@@ -86,46 +85,9 @@ function testStrictMode() {

8685

]);

8786

}

8887
89-

function testMagicMode() {

90-

const { replServer, output } = startNewREPLServer({

91-

prompt: testingReplPrompt,

92-

mode: repl.REPL_MODE_MAGIC,

93-

});

94-
95-

replServer.write(`_; // initial value undefined

96-

x = 10; //

97-

_; // last eval - 10

98-

let _ = 20; // undefined

99-

_; // 20 from user input

100-

_ = 30; // make sure we can set it twice and no prompt

101-

_; // 30 from user input

102-

var y = 40; // make sure eval doesn't change _

103-

_; // remains 30 from user input

104-

function f() { let _ = 50; return _; } // undefined

105-

f(); // 50

106-

_; // remains 30 from user input

107-

`);

108-
109-

assertOutput(output, [

110-

'undefined',

111-

'10',

112-

'10',

113-

'undefined',

114-

'20',

115-

'30',

116-

'30',

117-

'undefined',

118-

'30',

119-

'undefined',

120-

'50',

121-

'30',

122-

]);

123-

}

124-
12588

function testResetContext() {

12689

const { replServer, output } = startNewREPLServer({

12790

prompt: testingReplPrompt,

128-

mode: repl.REPL_MODE_MAGIC,

12991

});

13092
13193

replServer.write(`_ = 10; // explicitly set to 10