diff --git a/test/async-hooks/init-hooks.js b/test/async-hooks/init-hooks.js index c99383204ffe03..a5f835cdff3aaa 100644 --- a/test/async-hooks/init-hooks.js +++ b/test/async-hooks/init-hooks.js @@ -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() { diff --git a/test/parallel/test-repl-tab-complete.js b/test/parallel/test-repl-tab-complete.js index 994421ffc58a6a..85bcaf9e618ebc 100644 --- a/test/parallel/test-repl-tab-complete.js +++ b/test/parallel/test-repl-tab-complete.js @@ -411,7 +411,7 @@ const warningRegEx = new RegExp( }); // no `biu` - assert.strictEqual(data.indexOf('ele.biu'), -1); + assert.strictEqual(data.includes('ele.biu'), false); })); });