From 50130220dce8f699d0d3c76811fbdbbf8bc1ce4a Mon Sep 17 00:00:00 2001 From: cjihrig Date: Fri, 30 Dec 2016 10:09:13 -0500 Subject: [PATCH] test: s/assert.notEqual()/assert.notStrictEqual()/ PR-URL: https://github.com/nodejs/node/pull/10541 Reviewed-By: Sam Roberts Reviewed-By: Gibson Fahnestock Reviewed-By: James M Snell Reviewed-By: Rich Trott Reviewed-By: Italo A. Casas --- test/addons/load-long-path/test.js | 2 +- test/disabled/test-setuidgid.js | 4 +-- test/doctool/test-doctool-html.js | 2 +- test/fixtures/not-main-module.js | 6 ++--- .../test-child-process-spawn-shell.js | 2 +- .../test-child-process-spawnsync-shell.js | 2 +- test/parallel/test-console.js | 2 +- test/parallel/test-crypto-fips.js | 4 +-- test/parallel/test-crypto-hash.js | 6 ++--- ...n-throw-from-uncaught-exception-handler.js | 6 ++--- ...test-event-emitter-remove-all-listeners.js | 4 +-- test/parallel/test-fs-access.js | 4 +-- .../test-https-agent-disable-session-reuse.js | 4 +-- .../test-https-agent-session-reuse.js | 16 ++++++------ test/parallel/test-module-loading-error.js | 4 +-- test/parallel/test-net-keepalive.js | 2 +- .../test-net-listen-exclusive-random-ports.js | 2 +- test/parallel/test-net-remote-address-port.js | 26 +++++++++---------- test/parallel/test-process-cpuUsage.js | 2 +- test/parallel/test-regress-GH-7511.js | 2 +- test/parallel/test-regress-GH-node-9326.js | 2 +- ...ons-same-filename-as-dir-trailing-slash.js | 2 +- .../test-socket-write-after-fin-error.js | 2 +- ...emove-other-unref-timers-only-one-fires.js | 2 +- test/parallel/test-tls-handshake-error.js | 2 +- test/parallel/test-tls-set-ciphers.js | 2 +- ...est-whatwg-url-searchparams-constructor.js | 10 +++---- .../test-whatwg-url-searchparams-get.js | 2 +- test/parallel/test-zlib-sync-no-event.js | 2 +- 29 files changed, 64 insertions(+), 64 deletions(-) diff --git a/test/addons/load-long-path/test.js b/test/addons/load-long-path/test.js index 6e540fea559450..ea0783331b058f 100644 --- a/test/addons/load-long-path/test.js +++ b/test/addons/load-long-path/test.js @@ -33,5 +33,5 @@ fs.writeFileSync(addonDestinationPath, contents); // Attempt to load at long path destination const addon = require(addonDestinationPath); -assert.notEqual(addon, null); +assert.notStrictEqual(addon, null); assert.strictEqual(addon.hello(), 'world'); diff --git a/test/disabled/test-setuidgid.js b/test/disabled/test-setuidgid.js index 6b3b578f37991a..3603e9bb421a26 100644 --- a/test/disabled/test-setuidgid.js +++ b/test/disabled/test-setuidgid.js @@ -6,12 +6,12 @@ const assert = require('assert'); var oldgid = process.getgid(); process.setgid('nobody'); var newgid = process.getgid(); -assert.notEqual(newgid, oldgid, 'gids expected to be different'); +assert.notStrictEqual(newgid, oldgid, 'gids expected to be different'); var olduid = process.getuid(); process.setuid('nobody'); var newuid = process.getuid(); -assert.notEqual(newuid, olduid, 'uids expected to be different'); +assert.notStrictEqual(newuid, olduid, 'uids expected to be different'); try { process.setuid('nobody1234'); diff --git a/test/doctool/test-doctool-html.js b/test/doctool/test-doctool-html.js index 1745c8fea3df5c..e5c825aebbb32c 100644 --- a/test/doctool/test-doctool-html.js +++ b/test/doctool/test-doctool-html.js @@ -96,7 +96,7 @@ testData.forEach((item) => { const actual = output.replace(/\s/g, ''); // Assert that the input stripped of all whitespace contains the // expected list - assert.notEqual(actual.indexOf(expected), -1); + assert.notStrictEqual(actual.indexOf(expected), -1); })); })); })); diff --git a/test/fixtures/not-main-module.js b/test/fixtures/not-main-module.js index de024cd92ef942..4897a294eacb73 100644 --- a/test/fixtures/not-main-module.js +++ b/test/fixtures/not-main-module.js @@ -1,4 +1,4 @@ const assert = require('assert'); -assert.notEqual(module, require.main, 'require.main should not == module'); -assert.notEqual(module, process.mainModule, - 'process.mainModule should not === module'); +assert.notStrictEqual(module, require.main, 'require.main should not == module'); +assert.notStrictEqual(module, process.mainModule, + 'process.mainModule should not === module'); diff --git a/test/parallel/test-child-process-spawn-shell.js b/test/parallel/test-child-process-spawn-shell.js index 591fb409cb4cea..01411144bdc48f 100644 --- a/test/parallel/test-child-process-spawn-shell.js +++ b/test/parallel/test-child-process-spawn-shell.js @@ -6,7 +6,7 @@ const cp = require('child_process'); // Verify that a shell is, in fact, executed const doesNotExist = cp.spawn('does-not-exist', {shell: true}); -assert.notEqual(doesNotExist.spawnfile, 'does-not-exist'); +assert.notStrictEqual(doesNotExist.spawnfile, 'does-not-exist'); doesNotExist.on('error', common.fail); doesNotExist.on('exit', common.mustCall((code, signal) => { assert.strictEqual(signal, null); diff --git a/test/parallel/test-child-process-spawnsync-shell.js b/test/parallel/test-child-process-spawnsync-shell.js index fc42d56d105eaf..1d92767a8b5ba5 100644 --- a/test/parallel/test-child-process-spawnsync-shell.js +++ b/test/parallel/test-child-process-spawnsync-shell.js @@ -6,7 +6,7 @@ const cp = require('child_process'); // Verify that a shell is, in fact, executed const doesNotExist = cp.spawnSync('does-not-exist', {shell: true}); -assert.notEqual(doesNotExist.file, 'does-not-exist'); +assert.notStrictEqual(doesNotExist.file, 'does-not-exist'); assert.strictEqual(doesNotExist.error, undefined); assert.strictEqual(doesNotExist.signal, null); diff --git a/test/parallel/test-console.js b/test/parallel/test-console.js index ee7170bd9101ac..0eb7924cb6cbdc 100644 --- a/test/parallel/test-console.js +++ b/test/parallel/test-console.js @@ -115,7 +115,7 @@ assert.strictEqual("{ foo: 'bar', inspect: [Function: inspect] }\n", strings.shift()); assert.strictEqual("{ foo: 'bar', inspect: [Function: inspect] }\n", strings.shift()); -assert.notEqual(-1, strings.shift().indexOf('foo: [Object]')); +assert.ok(strings.shift().includes('foo: [Object]')); assert.strictEqual(-1, strings.shift().indexOf('baz')); assert.ok(/^label: \d+\.\d{3}ms$/.test(strings.shift().trim())); assert.ok(/^__proto__: \d+\.\d{3}ms$/.test(strings.shift().trim())); diff --git a/test/parallel/test-crypto-fips.js b/test/parallel/test-crypto-fips.js index 51ff8ef759850f..f27c59624730d2 100644 --- a/test/parallel/test-crypto-fips.js +++ b/test/parallel/test-crypto-fips.js @@ -47,10 +47,10 @@ function testHelper(stream, args, expectedOutput, cmd, env) { function responseHandler(buffer, expectedOutput) { const response = buffer.toString(); - assert.notEqual(0, response.length); + assert.notStrictEqual(response.length, 0); if (FIPS_ENABLED !== expectedOutput && FIPS_DISABLED !== expectedOutput) { // In the case of expected errors just look for a substring. - assert.notEqual(-1, response.indexOf(expectedOutput)); + assert.ok(response.includes(expectedOutput)); } else { // Normal path where we expect either FIPS enabled or disabled. assert.strictEqual(expectedOutput, Number(response)); diff --git a/test/parallel/test-crypto-hash.js b/test/parallel/test-crypto-hash.js index 473f01269db0a0..10135d2950c212 100644 --- a/test/parallel/test-crypto-hash.js +++ b/test/parallel/test-crypto-hash.js @@ -67,8 +67,8 @@ assert.deepStrictEqual( // stream interface should produce the same result. assert.deepStrictEqual(a5, a3, 'stream interface is consistent'); assert.deepStrictEqual(a6, a3, 'stream interface is consistent'); -assert.notEqual(a7, undefined, 'no data should return data'); -assert.notEqual(a8, undefined, 'empty string should generate data'); +assert.notStrictEqual(a7, undefined, 'no data should return data'); +assert.notStrictEqual(a8, undefined, 'empty string should generate data'); // Test multiple updates to same hash var h1 = crypto.createHash('sha1').update('Test123').digest('hex'); @@ -100,7 +100,7 @@ assert.strictEqual( '4b21bbd1a68e690a730ddcb5a8bc94ead9879ffe82580767ad7ec6fa8ba2dea6' + '43a821af66afa9a45b6a78c712fecf0e56dc7f43aef4bcfc8eb5b4d8dca6ea5b'); -assert.notEqual( +assert.notStrictEqual( hutf8, crypto.createHash('sha512').update('УТФ-8 text', 'latin1').digest('hex')); diff --git a/test/parallel/test-domain-throw-error-then-throw-from-uncaught-exception-handler.js b/test/parallel/test-domain-throw-error-then-throw-from-uncaught-exception-handler.js index a45f7d17a83a2c..d2277cfc0f74b7 100644 --- a/test/parallel/test-domain-throw-error-then-throw-from-uncaught-exception-handler.js +++ b/test/parallel/test-domain-throw-error-then-throw-from-uncaught-exception-handler.js @@ -72,9 +72,9 @@ function runTestWithAbortOnUncaughtException() { child_process.exec(createTestCmdLine({ withAbortOnUncaughtException: true }), function onTestDone(err, stdout, stderr) { - assert.notEqual(err.code, RAN_UNCAUGHT_EXCEPTION_HANDLER_EXIT_CODE, - 'child process should not have run its uncaughtException ' + - 'event handler'); + assert.notStrictEqual(err.code, RAN_UNCAUGHT_EXCEPTION_HANDLER_EXIT_CODE, + 'child process should not have run its ' + + 'uncaughtException event handler'); assert(common.nodeProcessAborted(err.code, err.signal), 'process should have aborted, but did not'); }); diff --git a/test/parallel/test-event-emitter-remove-all-listeners.js b/test/parallel/test-event-emitter-remove-all-listeners.js index e32a0e3f94f5b4..076c1ea1d7b80f 100644 --- a/test/parallel/test-event-emitter-remove-all-listeners.js +++ b/test/parallel/test-event-emitter-remove-all-listeners.js @@ -39,8 +39,8 @@ function listener() {} assert.deepStrictEqual(bazListeners, [listener, listener]); // After calling removeAllListeners(), // new listeners arrays is different from the old. - assert.notEqual(ee.listeners('bar'), barListeners); - assert.notEqual(ee.listeners('baz'), bazListeners); + assert.notStrictEqual(ee.listeners('bar'), barListeners); + assert.notStrictEqual(ee.listeners('baz'), bazListeners); } { diff --git a/test/parallel/test-fs-access.js b/test/parallel/test-fs-access.js index e3346556cfb7d1..a74ad9dccec271 100644 --- a/test/parallel/test-fs-access.js +++ b/test/parallel/test-fs-access.js @@ -72,7 +72,7 @@ fs.access(__filename, fs.R_OK, common.mustCall((err) => { })); fs.access(doesNotExist, common.mustCall((err) => { - assert.notEqual(err, null, 'error should exist'); + assert.notStrictEqual(err, null, 'error should exist'); assert.strictEqual(err.code, 'ENOENT'); assert.strictEqual(err.path, doesNotExist); })); @@ -85,7 +85,7 @@ fs.access(readOnlyFile, fs.W_OK, common.mustCall((err) => { if (hasWriteAccessForReadonlyFile) { assert.ifError(err); } else { - assert.notEqual(err, null, 'error should exist'); + assert.notStrictEqual(err, null, 'error should exist'); assert.strictEqual(err.path, readOnlyFile); } })); diff --git a/test/parallel/test-https-agent-disable-session-reuse.js b/test/parallel/test-https-agent-disable-session-reuse.js index dc9878d4a1c1ed..2f59118e3673ea 100644 --- a/test/parallel/test-https-agent-disable-session-reuse.js +++ b/test/parallel/test-https-agent-disable-session-reuse.js @@ -54,6 +54,6 @@ const server = https.createServer(options, function(req, res) { process.on('exit', function() { assert.equal(serverRequests, TOTAL_REQS); assert.equal(clientSessions.length, TOTAL_REQS); - assert.notEqual(clientSessions[0].toString('hex'), - clientSessions[1].toString('hex')); + assert.notStrictEqual(clientSessions[0].toString('hex'), + clientSessions[1].toString('hex')); }); diff --git a/test/parallel/test-https-agent-session-reuse.js b/test/parallel/test-https-agent-session-reuse.js index 73465aa5a98fb9..3f06d1699f2cde 100644 --- a/test/parallel/test-https-agent-session-reuse.js +++ b/test/parallel/test-https-agent-session-reuse.js @@ -117,14 +117,14 @@ process.on('exit', function() { assert.strictEqual(serverRequests, 6); assert.strictEqual(clientSessions['first'].toString('hex'), clientSessions['first-reuse'].toString('hex')); - assert.notEqual(clientSessions['first'].toString('hex'), - clientSessions['cipher-change'].toString('hex')); - assert.notEqual(clientSessions['first'].toString('hex'), - clientSessions['before-drop'].toString('hex')); - assert.notEqual(clientSessions['cipher-change'].toString('hex'), - clientSessions['before-drop'].toString('hex')); - assert.notEqual(clientSessions['before-drop'].toString('hex'), - clientSessions['after-drop'].toString('hex')); + assert.notStrictEqual(clientSessions['first'].toString('hex'), + clientSessions['cipher-change'].toString('hex')); + assert.notStrictEqual(clientSessions['first'].toString('hex'), + clientSessions['before-drop'].toString('hex')); + assert.notStrictEqual(clientSessions['cipher-change'].toString('hex'), + clientSessions['before-drop'].toString('hex')); + assert.notStrictEqual(clientSessions['before-drop'].toString('hex'), + clientSessions['after-drop'].toString('hex')); assert.strictEqual(clientSessions['after-drop'].toString('hex'), clientSessions['after-drop-reuse'].toString('hex')); }); diff --git a/test/parallel/test-module-loading-error.js b/test/parallel/test-module-loading-error.js index 1958fe65242221..b8454f2ae9ffb0 100644 --- a/test/parallel/test-module-loading-error.js +++ b/test/parallel/test-module-loading-error.js @@ -28,11 +28,11 @@ try { try { require(); } catch (e) { - assert.notEqual(e.toString().indexOf('missing path'), -1); + assert.ok(e.toString().includes('missing path')); } try { require({}); } catch (e) { - assert.notEqual(e.toString().indexOf('path must be a string'), -1); + assert.ok(e.toString().includes('path must be a string')); } diff --git a/test/parallel/test-net-keepalive.js b/test/parallel/test-net-keepalive.js index e466f0ff580d06..8b6998fa831a78 100644 --- a/test/parallel/test-net-keepalive.js +++ b/test/parallel/test-net-keepalive.js @@ -16,7 +16,7 @@ var echoServer = net.createServer(function(connection) { echoServer.close(); }, 1), common.platformTimeout(100)); connection.setTimeout(0); - assert.notEqual(connection.setKeepAlive, undefined); + assert.notStrictEqual(connection.setKeepAlive, undefined); // send a keepalive packet after 50 ms connection.setKeepAlive(true, common.platformTimeout(50)); connection.on('end', function() { diff --git a/test/parallel/test-net-listen-exclusive-random-ports.js b/test/parallel/test-net-listen-exclusive-random-ports.js index 4c5d056d9dfe54..974af6aaa60438 100644 --- a/test/parallel/test-net-listen-exclusive-random-ports.js +++ b/test/parallel/test-net-listen-exclusive-random-ports.js @@ -15,7 +15,7 @@ if (cluster.isMaster) { worker2.on('message', function(port2) { assert.equal(port2, port2 | 0, 'second worker could not listen'); - assert.notEqual(port1, port2, 'ports should not be equal'); + assert.notStrictEqual(port1, port2, 'ports should not be equal'); worker1.kill(); worker2.kill(); }); diff --git a/test/parallel/test-net-remote-address-port.js b/test/parallel/test-net-remote-address-port.js index 62a7ebfe572908..9cdf4ff7f876b8 100644 --- a/test/parallel/test-net-remote-address-port.js +++ b/test/parallel/test-net-remote-address-port.js @@ -13,16 +13,16 @@ var remoteFamilyCandidates = ['IPv4']; if (common.hasIPv6) remoteFamilyCandidates.push('IPv6'); var server = net.createServer(common.mustCall(function(socket) { - assert.notEqual(-1, remoteAddrCandidates.indexOf(socket.remoteAddress)); - assert.notEqual(-1, remoteFamilyCandidates.indexOf(socket.remoteFamily)); + assert.ok(remoteAddrCandidates.includes(socket.remoteAddress)); + assert.ok(remoteFamilyCandidates.includes(socket.remoteFamily)); assert.ok(socket.remotePort); - assert.notEqual(socket.remotePort, this.address().port); + assert.notStrictEqual(socket.remotePort, this.address().port); socket.on('end', function() { if (++conns_closed === 2) server.close(); }); socket.on('close', function() { - assert.notEqual(-1, remoteAddrCandidates.indexOf(socket.remoteAddress)); - assert.notEqual(-1, remoteFamilyCandidates.indexOf(socket.remoteFamily)); + assert.ok(remoteAddrCandidates.includes(socket.remoteAddress)); + assert.ok(remoteFamilyCandidates.includes(socket.remoteFamily)); }); socket.resume(); }, 2)); @@ -31,23 +31,23 @@ server.listen(0, 'localhost', function() { var client = net.createConnection(this.address().port, 'localhost'); var client2 = net.createConnection(this.address().port); client.on('connect', function() { - assert.notEqual(-1, remoteAddrCandidates.indexOf(client.remoteAddress)); - assert.notEqual(-1, remoteFamilyCandidates.indexOf(client.remoteFamily)); + assert.ok(remoteAddrCandidates.includes(client.remoteAddress)); + assert.ok(remoteFamilyCandidates.includes(client.remoteFamily)); assert.strictEqual(client.remotePort, server.address().port); client.end(); }); client.on('close', function() { - assert.notEqual(-1, remoteAddrCandidates.indexOf(client.remoteAddress)); - assert.notEqual(-1, remoteFamilyCandidates.indexOf(client.remoteFamily)); + assert.ok(remoteAddrCandidates.includes(client.remoteAddress)); + assert.ok(remoteFamilyCandidates.includes(client.remoteFamily)); }); client2.on('connect', function() { - assert.notEqual(-1, remoteAddrCandidates.indexOf(client2.remoteAddress)); - assert.notEqual(-1, remoteFamilyCandidates.indexOf(client2.remoteFamily)); + assert.ok(remoteAddrCandidates.includes(client2.remoteAddress)); + assert.ok(remoteFamilyCandidates.includes(client2.remoteFamily)); assert.strictEqual(client2.remotePort, server.address().port); client2.end(); }); client2.on('close', function() { - assert.notEqual(-1, remoteAddrCandidates.indexOf(client2.remoteAddress)); - assert.notEqual(-1, remoteFamilyCandidates.indexOf(client2.remoteFamily)); + assert.ok(remoteAddrCandidates.includes(client2.remoteAddress)); + assert.ok(remoteFamilyCandidates.includes(client2.remoteFamily)); }); }); diff --git a/test/parallel/test-process-cpuUsage.js b/test/parallel/test-process-cpuUsage.js index 0c553c576a1f25..062dac31cf7b5e 100644 --- a/test/parallel/test-process-cpuUsage.js +++ b/test/parallel/test-process-cpuUsage.js @@ -87,7 +87,7 @@ assert.throws(() => { // Ensure that the return value is the expected shape. function validateResult(result) { - assert.notEqual(result, null); + assert.notStrictEqual(result, null); assert(Number.isFinite(result.user)); assert(Number.isFinite(result.system)); diff --git a/test/parallel/test-regress-GH-7511.js b/test/parallel/test-regress-GH-7511.js index d18a3ae02c0d03..97e2fdb8114193 100644 --- a/test/parallel/test-regress-GH-7511.js +++ b/test/parallel/test-regress-GH-7511.js @@ -6,5 +6,5 @@ const vm = require('vm'); assert.doesNotThrow(function() { var context = vm.createContext({ process: process }); var result = vm.runInContext('process.env["PATH"]', context); - assert.notEqual(undefined, result); + assert.notStrictEqual(undefined, result); }); diff --git a/test/parallel/test-regress-GH-node-9326.js b/test/parallel/test-regress-GH-node-9326.js index 920a24e3a12c9a..3dbbe2958b8aef 100644 --- a/test/parallel/test-regress-GH-node-9326.js +++ b/test/parallel/test-regress-GH-node-9326.js @@ -10,5 +10,5 @@ var cp = child_process.spawn(process.execPath, [ ]); cp.on('exit', function(code) { - assert.notEqual(code, 0); + assert.notStrictEqual(code, 0); }); diff --git a/test/parallel/test-require-extensions-same-filename-as-dir-trailing-slash.js b/test/parallel/test-require-extensions-same-filename-as-dir-trailing-slash.js index 0a80a860388de9..aa749591eb553a 100644 --- a/test/parallel/test-require-extensions-same-filename-as-dir-trailing-slash.js +++ b/test/parallel/test-require-extensions-same-filename-as-dir-trailing-slash.js @@ -6,5 +6,5 @@ const assert = require('assert'); const content = require(common.fixturesDir + '/json-with-directory-name-module/module-stub/one-trailing-slash/two/three.js'); -assert.notEqual(content.rocko, 'artischocko'); +assert.notStrictEqual(content.rocko, 'artischocko'); assert.equal(content, 'hello from module-stub!'); diff --git a/test/parallel/test-socket-write-after-fin-error.js b/test/parallel/test-socket-write-after-fin-error.js index 8ceb0c65585750..0d280115a43653 100644 --- a/test/parallel/test-socket-write-after-fin-error.js +++ b/test/parallel/test-socket-write-after-fin-error.js @@ -49,7 +49,7 @@ server.listen(0, function() { assert(gotServerEnd); assert(gotServerError); assert.equal(gotServerError.code, 'EPIPE'); - assert.notEqual(gotServerError.message, 'write after end'); + assert.notStrictEqual(gotServerError.message, 'write after end'); console.log('ok'); }); diff --git a/test/parallel/test-timers-unref-remove-other-unref-timers-only-one-fires.js b/test/parallel/test-timers-unref-remove-other-unref-timers-only-one-fires.js index 971c485a4cf986..03c6cf7fd333a7 100644 --- a/test/parallel/test-timers-unref-remove-other-unref-timers-only-one-fires.js +++ b/test/parallel/test-timers-unref-remove-other-unref-timers-only-one-fires.js @@ -37,5 +37,5 @@ timers.enroll(foo, 1); timers._unrefActive(foo); setTimeout(function() { - assert.notEqual(nbTimersFired, 2); + assert.notStrictEqual(nbTimersFired, 2); }, 20); diff --git a/test/parallel/test-tls-handshake-error.js b/test/parallel/test-tls-handshake-error.js index 4d6a64a150c707..7623f816f3be07 100644 --- a/test/parallel/test-tls-handshake-error.js +++ b/test/parallel/test-tls-handshake-error.js @@ -25,7 +25,7 @@ var server = tls.createServer({ }); c.on('error', common.mustCall(function(err) { - assert.notEqual(err.code, 'ECONNRESET'); + assert.notStrictEqual(err.code, 'ECONNRESET'); })); c.on('close', common.mustCall(function(err) { diff --git a/test/parallel/test-tls-set-ciphers.js b/test/parallel/test-tls-set-ciphers.js index e61f8448be2923..ef08c56460c10d 100644 --- a/test/parallel/test-tls-set-ciphers.js +++ b/test/parallel/test-tls-set-ciphers.js @@ -26,7 +26,7 @@ const reply = 'I AM THE WALRUS'; // something recognizable let response = ''; process.on('exit', function() { - assert.notEqual(response.indexOf(reply), -1); + assert.ok(response.includes(reply)); }); const server = tls.createServer(options, common.mustCall(function(conn) { diff --git a/test/parallel/test-whatwg-url-searchparams-constructor.js b/test/parallel/test-whatwg-url-searchparams-constructor.js index 0b42eca5032d53..9b7ca1e4e9c54a 100644 --- a/test/parallel/test-whatwg-url-searchparams-constructor.js +++ b/test/parallel/test-whatwg-url-searchparams-constructor.js @@ -26,7 +26,7 @@ assert.throws(() => { }); }, TypeError); params = new URLSearchParams(''); -assert.notEqual(params, null, 'constructor returned non-null value.'); +assert.notStrictEqual(params, null, 'constructor returned non-null value.'); // eslint-disable-next-line no-proto assert.strictEqual(params.__proto__, URLSearchParams.prototype, 'expected URLSearchParams.prototype as prototype.'); @@ -36,19 +36,19 @@ assert.strictEqual(params + '', '%5Bobject%20Object%5D='); // URLSearchParams constructor, string. params = new URLSearchParams('a=b'); -assert.notEqual(params, null, 'constructor returned non-null value.'); +assert.notStrictEqual(params, null, 'constructor returned non-null value.'); assert.strictEqual(true, params.has('a'), 'Search params object has name "a"'); assert.strictEqual(false, params.has('b'), 'Search params object has not got name "b"'); params = new URLSearchParams('a=b&c'); -assert.notEqual(params, null, 'constructor returned non-null value.'); +assert.notStrictEqual(params, null, 'constructor returned non-null value.'); assert.strictEqual(true, params.has('a'), 'Search params object has name "a"'); assert.strictEqual(true, params.has('c'), 'Search params object has name "c"'); params = new URLSearchParams('&a&&& &&&&&a+b=& c&m%c3%b8%c3%b8'); -assert.notEqual(params, null, 'constructor returned non-null value.'); +assert.notStrictEqual(params, null, 'constructor returned non-null value.'); assert.strictEqual(true, params.has('a'), 'Search params object has name "a"'); assert.strictEqual(true, params.has('a b'), 'Search params object has name "a b"'); @@ -64,7 +64,7 @@ assert.strictEqual(true, params.has('møø'), // URLSearchParams constructor, object. const seed = new URLSearchParams('a=b&c=d'); params = new URLSearchParams(seed); -assert.notEqual(params, null, 'constructor returned non-null value.'); +assert.notStrictEqual(params, null, 'constructor returned non-null value.'); assert.strictEqual(params.get('a'), 'b'); assert.strictEqual(params.get('c'), 'd'); assert.strictEqual(false, params.has('d')); diff --git a/test/parallel/test-whatwg-url-searchparams-get.js b/test/parallel/test-whatwg-url-searchparams-get.js index aa3a0d9929bf52..7ddfb67e8b8a7b 100644 --- a/test/parallel/test-whatwg-url-searchparams-get.js +++ b/test/parallel/test-whatwg-url-searchparams-get.js @@ -20,7 +20,7 @@ assert.strictEqual(params.get('a'), ''); // More get() basics params = new URLSearchParams('first=second&third&&'); -assert.notEqual(params, null, 'constructor returned non-null value.'); +assert.notStrictEqual(params, null, 'constructor returned non-null value.'); assert.strictEqual(true, params.has('first'), 'Search params object has name "first"'); assert.strictEqual(params.get('first'), 'second', diff --git a/test/parallel/test-zlib-sync-no-event.js b/test/parallel/test-zlib-sync-no-event.js index 46ea97fbf4dd83..d6eb1f3c9df6a3 100644 --- a/test/parallel/test-zlib-sync-no-event.js +++ b/test/parallel/test-zlib-sync-no-event.js @@ -17,5 +17,5 @@ const unzipper = new zlib.Gunzip(); unzipper.on('close', shouldNotBeCalled); const unzipped = unzipper._processChunk(zipped, zlib.constants.Z_FINISH); -assert.notEqual(zipped.toString(), message); +assert.notStrictEqual(zipped.toString(), message); assert.strictEqual(unzipped.toString(), message);