Skip to content

Commit

Permalink
test: replace indexOf with includes
Browse files Browse the repository at this point in the history
PR-URL: #13215
Refs: #12586
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
  • Loading branch information
thelostone-mc authored and MylesBorins committed Aug 16, 2017
1 parent c7025de commit b793fc6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion test/parallel/test-http-client-agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ function request(i) {
socket.on('close', function() {
++count;
if (count < max) {
assert.strictEqual(http.globalAgent.sockets[name].indexOf(socket), -1);
assert.strictEqual(http.globalAgent.sockets[name].includes(socket),
false);
} else {
assert(!http.globalAgent.sockets.hasOwnProperty(name));
assert(!http.globalAgent.requests.hasOwnProperty(name));
Expand Down
6 changes: 3 additions & 3 deletions test/parallel/test-http-client-default-headers-exist.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ const server = http.createServer(function(req, res) {

const requestHeaders = Object.keys(req.headers);
requestHeaders.forEach(function(header) {
assert.notStrictEqual(
expectedHeaders[req.method].indexOf(header.toLowerCase()),
-1,
assert.strictEqual(
expectedHeaders[req.method].includes(header.toLowerCase()),
true,
`${header} should not exist for method ${req.method}`
);
});
Expand Down

0 comments on commit b793fc6

Please sign in to comment.