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
3 changes: 1 addition & 2 deletions test/common/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ function runBenchmark(name, env) {

for (let testIdx = 1; testIdx < splitTests.length - 1; testIdx++) {
const lines = splitTests[testIdx].split('\n');
assert.ok(/.+/.test(lines[0]));

assert.match(lines[0], /.+/);
if (!lines[1].includes('group="')) {
assert.strictEqual(lines.length, 2, `benchmark file not running exactly one configuration in test: ${stdout}`);
}
Expand Down
2 changes: 1 addition & 1 deletion test/js-native-api/test_general/testV8Instanceof2.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ function InstanceTest(x, func) {
const answer = addon.doInstanceOf(x, func);
assert.strictEqual(correct_answers[correct_answer_index], answer);
} catch (e) {
assert.ok(/prototype/.test(e));
assert.match(e, /prototype/);
assert.strictEqual(correct_answers[correct_answer_index], except);
}
correct_answer_index++;
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-dns-resolver-max-timeout.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const dgram = require('dgram');
try {
new dns.Resolver({ maxTimeout });
} catch (e) {
assert.ok(/ERR_OUT_OF_RANGE|ERR_INVALID_ARG_TYPE/i.test(e.code));
assert.match(e.code, /ERR_OUT_OF_RANGE|ERR_INVALID_ARG_TYPE/i);
}
});

Expand Down
5 changes: 4 additions & 1 deletion test/parallel/test-http2-https-fallback.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@ function onSession(session, next) {
.setEncoding('utf8')
.on('data', (chunk) => text += chunk)
.on('end', common.mustCall(() => {
assert.ok(/Missing ALPN Protocol, expected `h2` to be available/.test(text));
assert.match(
text,
/Missing ALPN Protocol, expected `h2` to be available/
);
cleanup();
}));
}
Expand Down
5 changes: 4 additions & 1 deletion test/parallel/test-runner-mock-timers-date.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ describe('Mock Timers Date Test Suite', () => {
const returned = Date();
// Matches the format: 'Mon Jan 01 1970 00:00:00'
// We don't care about the date, just the format
assert.ok(/\w{3}\s\w{3}\s\d{1,2}\s\d{2,4}\s\d{1,2}:\d{2}:\d{2}/.test(returned));
assert.match(
returned,
/\w{3}\s\w{3}\s\d{1,2}\s\d{2,4}\s\d{1,2}:\d{2}:\d{2}/
);
});

it('should return the date with different argument calls', (t) => {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-worker-cpu-usage.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function check(worker) {
try {
worker.cpuUsage(value);
} catch (e) {
assert.ok(/ERR_OUT_OF_RANGE|ERR_INVALID_ARG_TYPE/i.test(e.code));
assert.match(e.code, /ERR_OUT_OF_RANGE|ERR_INVALID_ARG_TYPE/i);
}
});
}
Expand Down