Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: replace indexOf with includes
Refs: #12586
  • Loading branch information
maasencioh committed Aug 4, 2017
commit 08204027b34a4eb5a36c9a7f1ea8ea81ae3ba11e
4 changes: 2 additions & 2 deletions test/async-hooks/init-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) +
Expand Down Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-repl-tab-complete.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ const warningRegEx = new RegExp(
});

// no `biu`
assert.strictEqual(data.indexOf('ele.biu'), -1);
assert.strictEqual(data.includes('ele.biu'), false);
}));
});

Expand Down