The Wayback Machine - https://web.archive.org/web/20250407172920/https://github.com/nodejs/node/commit/baa0adfe46
Skip to content

Navigation Menu

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

Commit baa0adf

Browse filesBrowse files
ftatiezeaddaleax
authored andcommitted
test: using const and strictEqual
PR-URL: #9926 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 8ceca4a commit baa0adf
Copy full SHA for baa0adf

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

‎test/parallel/test-console-instance.js

Copy file name to clipboardexpand all lines: 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

Copy file name to clipboard
+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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.