Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9fddf29

Browse filesBrowse files
cesarhqFishrock123
authored andcommitted
test: refactor test-repl-mode.js
* var -> const/let * assert.equal() -> assert.strictEqual() PR-URL: #10061 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
1 parent 65c4483 commit 9fddf29
Copy full SHA for 9fddf29

File tree

Expand file treeCollapse file tree

1 file changed

+15
-15
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+15
-15
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-repl-mode.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-repl-mode.js
+15-15Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.