Skip to content
Permalink
Browse files

test: replace `indexOf` with `includes`

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 jasnell committed May 25, 2017
1 parent 4f4d5d2 commit 8d193919fbfe0bb472ccd3f07e852d9f281cecd8
@@ -55,7 +55,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));
@@ -46,9 +46,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}`
);
});

0 comments on commit 8d19391

Please sign in to comment.
You can’t perform that action at this time.