test: replace indexOf with includes
Refs: https://github.com/nodejs/node/issues/12586 PR-URL: https://github.com/nodejs/node/pull/14630 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
This commit is contained in:
parent
e67220ec81
commit
9564c20810
@ -67,7 +67,7 @@ class ActivityCollector {
|
||||
const violations = [];
|
||||
function v(msg) { violations.push(msg); }
|
||||
for (const a of this._activities.values()) {
|
||||
if (types != null && types.indexOf(a.type) < 0) continue;
|
||||
if (types != null && !types.includes(a.type)) continue;
|
||||
|
||||
if (a.init && a.init.length > 1) {
|
||||
v('Activity inited twice\n' + activityString(a) +
|
||||
@ -131,7 +131,7 @@ class ActivityCollector {
|
||||
|
||||
activitiesOfTypes(types) {
|
||||
if (!Array.isArray(types)) types = [ types ];
|
||||
return this.activities.filter((x) => types.indexOf(x.type) >= 0);
|
||||
return this.activities.filter((x) => types.includes(x.type));
|
||||
}
|
||||
|
||||
get activities() {
|
||||
|
@ -411,7 +411,7 @@ const warningRegEx = new RegExp(
|
||||
});
|
||||
|
||||
// no `biu`
|
||||
assert.strictEqual(data.indexOf('ele.biu'), -1);
|
||||
assert.strictEqual(data.includes('ele.biu'), false);
|
||||
}));
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user