Skip to content

Commit 2e36b2e

Browse files
ftatiezeFishrock123
authored andcommitted
test: using const and strictEqual
PR-URL: #9926 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 8e27254 commit 2e36b2e

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

test/parallel/test-console-instance.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ process.stdout.write = process.stderr.write = function() {
1515
};
1616

1717
// make sure that the "Console" function exists
18-
assert.equal('function', typeof Console);
18+
assert.strictEqual('function', typeof Console);
1919

2020
// make sure that the Console constructor throws
2121
// when not given a writable stream instance
@@ -35,7 +35,7 @@ out.write = err.write = function(d) {};
3535
var c = new Console(out, err);
3636

3737
out.write = err.write = function(d) {
38-
assert.equal(d, 'test\n');
38+
assert.strictEqual(d, 'test\n');
3939
called = true;
4040
};
4141

@@ -48,7 +48,7 @@ c.error('test');
4848
assert(called);
4949

5050
out.write = function(d) {
51-
assert.equal('{ foo: 1 }\n', d);
51+
assert.strictEqual('{ foo: 1 }\n', d);
5252
called = true;
5353
};
5454

@@ -60,10 +60,10 @@ assert(called);
6060
called = 0;
6161
out.write = function(d) {
6262
called++;
63-
assert.equal(d, called + ' ' + (called - 1) + ' [ 1, 2, 3 ]\n');
63+
assert.strictEqual(d, called + ' ' + (called - 1) + ' [ 1, 2, 3 ]\n');
6464
};
6565
[1, 2, 3].forEach(c.log);
66-
assert.equal(3, called);
66+
assert.strictEqual(3, called);
6767

6868
// Console() detects if it is called without `new` keyword
6969
assert.doesNotThrow(function() {

test/parallel/test-dgram-msgsize.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
'use strict';
2-
var common = require('../common');
3-
var assert = require('assert');
4-
var dgram = require('dgram');
2+
const common = require('../common');
3+
const assert = require('assert');
4+
const dgram = require('dgram');
55

66
// Send a too big datagram. The destination doesn't matter because it's
77
// not supposed to get sent out anyway.
8-
var buf = Buffer.allocUnsafe(256 * 1024);
9-
var sock = dgram.createSocket('udp4');
8+
const buf = Buffer.allocUnsafe(256 * 1024);
9+
const sock = dgram.createSocket('udp4');
1010
sock.send(buf, 0, buf.length, 12345, '127.0.0.1', common.mustCall(cb));
1111
function cb(err) {
1212
assert(err instanceof Error);
13-
assert.equal(err.code, 'EMSGSIZE');
14-
assert.equal(err.address, '127.0.0.1');
15-
assert.equal(err.port, 12345);
16-
assert.equal(err.message, 'send EMSGSIZE 127.0.0.1:12345');
13+
assert.strictEqual(err.code, 'EMSGSIZE');
14+
assert.strictEqual(err.address, '127.0.0.1');
15+
assert.strictEqual(err.port, 12345);
16+
assert.strictEqual(err.message, 'send EMSGSIZE 127.0.0.1:12345');
1717
sock.close();
1818
}

0 commit comments

Comments
 (0)