Skip to content

Commit

Permalink
test: refactor indexOf uses to es6 equivalents
Browse files Browse the repository at this point in the history
refactor indexOf uses to es6 where applicable

Refs: #12586
  • Loading branch information
Bnaya committed Jun 21, 2017
1 parent 32c7f11 commit f40503a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions test/pummel/test-dtrace-jsstack.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ dtrace.on('exit', function(code) {
for (let i = 0; i < lines.length; i++) {
const line = lines[i];

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

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

assert.strictEqual(frame.indexOf(top), 0,
`unexpected frame where ${top} was expected`);
assert.ok(frame.startsWith(top),
`unexpected frame where ${top} was expected`);
}

assert.strictEqual(frames.length, 0,
Expand Down
2 changes: 1 addition & 1 deletion test/pummel/test-regress-GH-814.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const tail = require('child_process').spawn('tail', ['-f', testFileName]);
tail.stdout.on('data', tailCB);

function tailCB(data) {
PASS = data.toString().indexOf('.') < 0;
PASS = !data.toString().includes('.');
}


Expand Down
2 changes: 1 addition & 1 deletion test/pummel/test-regress-GH-814_2.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const tailProc = require('child_process').spawn('tail', ['-f', testFileName]);
tailProc.stdout.on('data', tailCB);

function tailCB(data) {
PASS = data.toString().indexOf('.') < 0;
PASS = !data.toString().includes('.');

if (PASS) {
//console.error('i');
Expand Down

0 comments on commit f40503a

Please sign in to comment.