Skip to content

Commit b793fc6

Browse files
thelostone-mcMylesBorins
authored andcommitted
test: replace indexOf with includes
PR-URL: #13215 Refs: #12586 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
1 parent c7025de commit b793fc6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

test/parallel/test-http-client-agent.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ function request(i) {
3434
socket.on('close', function() {
3535
++count;
3636
if (count < max) {
37-
assert.strictEqual(http.globalAgent.sockets[name].indexOf(socket), -1);
37+
assert.strictEqual(http.globalAgent.sockets[name].includes(socket),
38+
false);
3839
} else {
3940
assert(!http.globalAgent.sockets.hasOwnProperty(name));
4041
assert(!http.globalAgent.requests.hasOwnProperty(name));

test/parallel/test-http-client-default-headers-exist.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ const server = http.createServer(function(req, res) {
2525

2626
const requestHeaders = Object.keys(req.headers);
2727
requestHeaders.forEach(function(header) {
28-
assert.notStrictEqual(
29-
expectedHeaders[req.method].indexOf(header.toLowerCase()),
30-
-1,
28+
assert.strictEqual(
29+
expectedHeaders[req.method].includes(header.toLowerCase()),
30+
true,
3131
`${header} should not exist for method ${req.method}`
3232
);
3333
});

0 commit comments

Comments
 (0)