-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: s/assert.notEqual()/assert.notStrictEqual()/ #10541
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM if CI is ✅ . Left some nits, but they can be ignored and someone can do them later if they feel strongly about it.
@@ -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.notStrictEqual(-1, strings.shift().indexOf('foo: [Object]')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For readability, might be good to change this to assert(strings.shift().includes('foo: [Object]'));
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.notStrictEqual(-1, response.indexOf(expectedOutput)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be good to use .includes()
here and change assert.notStrictEqual()
to assert()
.
@@ -28,11 +28,11 @@ try { | |||
try { | |||
require(); | |||
} catch (e) { | |||
assert.notEqual(e.toString().indexOf('missing path'), -1); | |||
assert.notStrictEqual(e.toString().indexOf('missing path'), -1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
} | ||
|
||
try { | ||
require({}); | ||
} catch (e) { | ||
assert.notEqual(e.toString().indexOf('path must be a string'), -1); | ||
assert.notStrictEqual(e.toString().indexOf('path must be a string'), -1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
@@ -13,16 +13,19 @@ 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.notStrictEqual(-1, remoteAddrCandidates.indexOf(socket.remoteAddress)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and the next line too. I'll stop. You get the idea. :-D
Nit: commit message should start with an imperative verb. Although I guess arguably the |
FWIW, I went with |
New CI with @Trott's suggestions: https://ci.nodejs.org/job/node-test-pull-request/5729/ |
PR-URL: nodejs#10541 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com>
PR-URL: nodejs#10541 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com>
PR-URL: nodejs#10541 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com>
PR-URL: #10541 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com>
PR-URL: nodejs#10541 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com>
PR-URL: nodejs#10541 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com>
This will need backport PRs to land on v4 and v6 |
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test