Skip to content

Commit 9c64278

Browse files
thelostone-mcrefack
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 c1a4b53 commit 9c64278

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ function request(i) {
5555
socket.on('close', function() {
5656
++count;
5757
if (count < max) {
58-
assert.strictEqual(http.globalAgent.sockets[name].indexOf(socket), -1);
58+
assert.strictEqual(http.globalAgent.sockets[name].includes(socket),
59+
false);
5960
} else {
6061
assert(!http.globalAgent.sockets.hasOwnProperty(name));
6162
assert(!http.globalAgent.requests.hasOwnProperty(name));

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ const server = http.createServer(function(req, res) {
4646

4747
const requestHeaders = Object.keys(req.headers);
4848
requestHeaders.forEach(function(header) {
49-
assert.notStrictEqual(
50-
expectedHeaders[req.method].indexOf(header.toLowerCase()),
51-
-1,
49+
assert.strictEqual(
50+
expectedHeaders[req.method].includes(header.toLowerCase()),
51+
true,
5252
`${header} should not exist for method ${req.method}`
5353
);
5454
});

0 commit comments

Comments
 (0)