test: add lint rule to forbid use of assert.ok(/regex/.test(…))

PR-URL: https://github.com/nodejs/node/pull/60832
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
This commit is contained in:
Antoine du Hamel committed 2026-01-19 19:19:12 +01:00
1 parent 6a6fc0c851
commit 1fb83e240d
12 files changed
+43 -33

No files matched your search

+1 -1
View File
@@ -165,7 +165,7 @@ 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();
}));
}