Skip to content

Commit ce91bb2

Browse files
cesarhqMylesBorins
authored andcommitted
test: refactor test-repl-mode.js
* var -> const/let * assert.equal() -> assert.strictEqual() PR-URL: #10061 Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
1 parent 61cbc20 commit ce91bb2

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

test/parallel/test-repl-mode.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
'use strict';
2-
var common = require('../common');
3-
var assert = require('assert');
4-
var Stream = require('stream');
5-
var repl = require('repl');
2+
const common = require('../common');
3+
const assert = require('assert');
4+
const Stream = require('stream');
5+
const repl = require('repl');
66

77
common.globalCheck = false;
88

9-
var tests = [
9+
const tests = [
1010
testSloppyMode,
1111
testStrictMode,
1212
testAutoMode
@@ -17,12 +17,12 @@ tests.forEach(function(test) {
1717
});
1818

1919
function testSloppyMode() {
20-
var cli = initRepl(repl.REPL_MODE_SLOPPY);
20+
const cli = initRepl(repl.REPL_MODE_SLOPPY);
2121

2222
cli.input.emit('data', `
2323
x = 3
2424
`.trim() + '\n');
25-
assert.equal(cli.output.accumulator.join(''), '> 3\n> ');
25+
assert.strictEqual(cli.output.accumulator.join(''), '> 3\n> ');
2626
cli.output.accumulator.length = 0;
2727

2828
cli.input.emit('data', `
@@ -33,7 +33,7 @@ function testSloppyMode() {
3333
}
3434

3535
function testStrictMode() {
36-
var cli = initRepl(repl.REPL_MODE_STRICT);
36+
const cli = initRepl(repl.REPL_MODE_STRICT);
3737

3838
cli.input.emit('data', `
3939
x = 3
@@ -45,30 +45,30 @@ function testStrictMode() {
4545
cli.input.emit('data', `
4646
let y = 3
4747
`.trim() + '\n');
48-
assert.equal(cli.output.accumulator.join(''), 'undefined\n> ');
48+
assert.strictEqual(cli.output.accumulator.join(''), 'undefined\n> ');
4949
}
5050

5151
function testAutoMode() {
52-
var cli = initRepl(repl.REPL_MODE_MAGIC);
52+
const cli = initRepl(repl.REPL_MODE_MAGIC);
5353

5454
cli.input.emit('data', `
5555
x = 3
5656
`.trim() + '\n');
57-
assert.equal(cli.output.accumulator.join(''), '> 3\n> ');
57+
assert.strictEqual(cli.output.accumulator.join(''), '> 3\n> ');
5858
cli.output.accumulator.length = 0;
5959

6060
cli.input.emit('data', `
6161
let y = 3
6262
`.trim() + '\n');
63-
assert.equal(cli.output.accumulator.join(''), 'undefined\n> ');
63+
assert.strictEqual(cli.output.accumulator.join(''), 'undefined\n> ');
6464
}
6565

6666
function initRepl(mode) {
67-
var input = new Stream();
67+
const input = new Stream();
6868
input.write = input.pause = input.resume = function() {};
6969
input.readable = true;
7070

71-
var output = new Stream();
71+
const output = new Stream();
7272
output.write = output.pause = output.resume = function(buf) {
7373
output.accumulator.push(buf);
7474
};

0 commit comments

Comments
 (0)