Skip to content

Commit 55aba6a

Browse files
maasenciohaddaleax
authored andcommitted
test: replace indexOf with includes
Refs: #12586 PR-URL: #14630 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]>
1 parent 574cc37 commit 55aba6a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

test/async-hooks/init-hooks.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class ActivityCollector {
6767
const violations = [];
6868
function v(msg) { violations.push(msg); }
6969
for (const a of this._activities.values()) {
70-
if (types != null && types.indexOf(a.type) < 0) continue;
70+
if (types != null && !types.includes(a.type)) continue;
7171

7272
if (a.init && a.init.length > 1) {
7373
v('Activity inited twice\n' + activityString(a) +
@@ -131,7 +131,7 @@ class ActivityCollector {
131131

132132
activitiesOfTypes(types) {
133133
if (!Array.isArray(types)) types = [ types ];
134-
return this.activities.filter((x) => types.indexOf(x.type) >= 0);
134+
return this.activities.filter((x) => types.includes(x.type));
135135
}
136136

137137
get activities() {

test/parallel/test-repl-tab-complete.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ const warningRegEx = new RegExp(
411411
});
412412

413413
// no `biu`
414-
assert.strictEqual(data.indexOf('ele.biu'), -1);
414+
assert.strictEqual(data.includes('ele.biu'), false);
415415
}));
416416
});
417417

0 commit comments

Comments
 (0)