Skip to content

Commit f40503a

Browse files
committed
test: refactor indexOf uses to es6 equivalents
refactor indexOf uses to es6 where applicable Refs: #12586
1 parent 32c7f11 commit f40503a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

test/pummel/test-dtrace-jsstack.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,14 @@ dtrace.on('exit', function(code) {
8686
for (let i = 0; i < lines.length; i++) {
8787
const line = lines[i];
8888

89-
if (line.indexOf(sentinel) === -1 || frames.length === 0)
89+
if (!line.includes(sentinel) || frames.length === 0)
9090
continue;
9191

9292
const frame = line.substr(line.indexOf(sentinel) + sentinel.length);
9393
const top = frames.shift();
9494

95-
assert.strictEqual(frame.indexOf(top), 0,
96-
`unexpected frame where ${top} was expected`);
95+
assert.ok(frame.startsWith(top),
96+
`unexpected frame where ${top} was expected`);
9797
}
9898

9999
assert.strictEqual(frames.length, 0,

test/pummel/test-regress-GH-814.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const tail = require('child_process').spawn('tail', ['-f', testFileName]);
5151
tail.stdout.on('data', tailCB);
5252

5353
function tailCB(data) {
54-
PASS = data.toString().indexOf('.') < 0;
54+
PASS = !data.toString().includes('.');
5555
}
5656

5757

test/pummel/test-regress-GH-814_2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const tailProc = require('child_process').spawn('tail', ['-f', testFileName]);
3535
tailProc.stdout.on('data', tailCB);
3636

3737
function tailCB(data) {
38-
PASS = data.toString().indexOf('.') < 0;
38+
PASS = !data.toString().includes('.');
3939

4040
if (PASS) {
4141
//console.error('i');

0 commit comments

Comments
 (0)