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 c286312

Browse filesBrowse files
brad-deckeraddaleax
authored andcommitted
test: replace assert.equal with assert.strictEqual
Using NodeTodo I learned of a need to swap out the .equal function with .strictEqual in a few test files. https://twitter.com/NodeTodo/status/803657321993961472 https://gist.github.com/Trott/864401455d4afa2428cd4814e072bd7c additional commits squashed: .strictEqual's argument signature is actual, expected, [message]. Previously some statements were listed as expected, actual. As asked in PR i swapped them to match the correct argument signature. PR-URL: #9842 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
1 parent 0ccb2c3 commit c286312
Copy full SHA for c286312

File tree

Expand file treeCollapse file tree

7 files changed

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

7 files changed

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

‎test/addons/async-hello-world/test.js‎

Copy file name to clipboardExpand all lines: test/addons/async-hello-world/test.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var assert = require('assert');
44
const binding = require(`./build/${common.buildType}/binding`);
55

66
binding(5, common.mustCall(function(err, val) {
7-
assert.equal(null, err);
8-
assert.equal(10, val);
7+
assert.strictEqual(err, null);
8+
assert.strictEqual(val, 10);
99
process.nextTick(common.mustCall(function() {}));
1010
}));
Collapse file

‎test/addons/hello-world-function-export/test.js‎

Copy file name to clipboardExpand all lines: test/addons/hello-world-function-export/test.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
const common = require('../../common');
33
var assert = require('assert');
44
const binding = require(`./build/${common.buildType}/binding`);
5-
assert.equal('world', binding());
5+
assert.strictEqual(binding(), 'world');
66
console.log('binding.hello() =', binding());
Collapse file

‎test/addons/hello-world/test.js‎

Copy file name to clipboardExpand all lines: test/addons/hello-world/test.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
const common = require('../../common');
33
var assert = require('assert');
44
const binding = require(`./build/${common.buildType}/binding`);
5-
assert.equal('world', binding.hello());
5+
assert.strictEqual(binding.hello(), 'world');
66
console.log('binding.hello() =', binding.hello());
Collapse file

‎test/addons/load-long-path/test.js‎

Copy file name to clipboardExpand all lines: test/addons/load-long-path/test.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ fs.writeFileSync(addonDestinationPath, contents);
3434
// Attempt to load at long path destination
3535
var addon = require(addonDestinationPath);
3636
assert.notEqual(addon, null);
37-
assert.equal(addon.hello(), 'world');
37+
assert.strictEqual(addon.hello(), 'world');
Collapse file

‎test/addons/stringbytes-external-exceed-max/test-stringbytes-external-at-max.js‎

Copy file name to clipboardExpand all lines: test/addons/stringbytes-external-exceed-max/test-stringbytes-external-at-max.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ if (!binding.ensureAllocation(2 * kStringMaxLength)) {
3030
}
3131

3232
const maxString = buf.toString('latin1');
33-
assert.equal(maxString.length, kStringMaxLength);
33+
assert.strictEqual(maxString.length, kStringMaxLength);
Collapse file

‎test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-binary.js‎

Copy file name to clipboardExpand all lines: test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-binary.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ assert.throws(function() {
3434
}, /"toString\(\)" failed/);
3535

3636
var maxString = buf.toString('latin1', 1);
37-
assert.equal(maxString.length, kStringMaxLength);
37+
assert.strictEqual(maxString.length, kStringMaxLength);
3838
// Free the memory early instead of at the end of the next assignment
3939
maxString = undefined;
4040

4141
maxString = buf.toString('latin1', 0, kStringMaxLength);
42-
assert.equal(maxString.length, kStringMaxLength);
42+
assert.strictEqual(maxString.length, kStringMaxLength);
Collapse file

‎test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-2.js‎

Copy file name to clipboardExpand all lines: test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-2.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ if (!binding.ensureAllocation(2 * kStringMaxLength)) {
3030
}
3131

3232
const maxString = buf.toString('utf16le');
33-
assert.equal(maxString.length, (kStringMaxLength + 2) / 2);
33+
assert.strictEqual(maxString.length, (kStringMaxLength + 2) / 2);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.