Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: refactor indexOf uses to es6 equivalents #13853

Closed
wants to merge 1 commit into from
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
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