Skip to content

Commit f78b817

Browse files
cesarhqaddaleax
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 2127798 commit f78b817

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

test/parallel/test-repl-mode.js

Lines changed: 15 additions & 15 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,22 +17,22 @@ 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', `
2929
let y = 3
3030
`.trim() + '\n');
31-
assert.equal(cli.output.accumulator.join(''), 'undefined\n> ');
31+
assert.strictEqual(cli.output.accumulator.join(''), 'undefined\n> ');
3232
}
3333

3434
function testStrictMode() {
35-
var cli = initRepl(repl.REPL_MODE_STRICT);
35+
const cli = initRepl(repl.REPL_MODE_STRICT);
3636

3737
cli.input.emit('data', `
3838
x = 3
@@ -44,30 +44,30 @@ function testStrictMode() {
4444
cli.input.emit('data', `
4545
let y = 3
4646
`.trim() + '\n');
47-
assert.equal(cli.output.accumulator.join(''), 'undefined\n> ');
47+
assert.strictEqual(cli.output.accumulator.join(''), 'undefined\n> ');
4848
}
4949

5050
function testAutoMode() {
51-
var cli = initRepl(repl.REPL_MODE_MAGIC);
51+
const cli = initRepl(repl.REPL_MODE_MAGIC);
5252

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

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

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

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

0 commit comments

Comments
 (0)