Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add removed tests
  • Loading branch information
princejwesley committed Jul 26, 2016
commit d4e5054f72350499eee403e178b24736c14dfe02
2 changes: 1 addition & 1 deletion lib/internal/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function createRepl(env, opts, cb) {
opts.replMode = {
'strict': REPL.REPL_MODE_STRICT,
'sloppy': REPL.REPL_MODE_SLOPPY,
'magic': REPL.REPL_MODE_MAGIC,
'magic': REPL.REPL_MODE_MAGIC
}[String(env.NODE_REPL_MODE).toLowerCase().trim()];

if (opts.replMode === undefined) {
Expand Down
13 changes: 13 additions & 0 deletions test/parallel/test-repl-mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,21 @@ function testStrictMode() {

function testAutoMode() {
var cli = initRepl(repl.REPL_MODE_MAGIC);

assert.equal(cli.output.accumulator.join(''),
'magic mode is deprecated. Switched to sloppy mode\n> ');
Copy link
Copy Markdown
Member

@ChALkeR ChALkeR Jul 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the behaviour should not be affected, why remove existing tests? The two ones that were here.

cli.output.accumulator.length = 0;

cli.input.emit('data', `
x = 3
`.trim() + '\n');
assert.equal(cli.output.accumulator.join(''), '3\n> ');
cli.output.accumulator.length = 0;

cli.input.emit('data', `
let y = 3
`.trim() + '\n');
assert.equal(cli.output.accumulator.join(''), 'undefined\n> ');
}

function initRepl(mode) {
Expand Down