FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test: replace indexOf with includes · nodejs/node@55aba6a · GitHub

/ node Public

Commit 55aba6a

Browse files
authored andcommitted
test: replace indexOf with includes
Refs: #12586 PR-URL: #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>
1 parent 574cc37 commit 55aba6a

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎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)

Back | FazBrowse Home | New Git URL