From 1e76a99dbf3f13bc48ed3081c28616e09dab26e3 Mon Sep 17 00:00:00 2001 From: Aditya Chopra Date: Sat, 27 Dec 2025 23:19:05 +0530 Subject: [PATCH] test: avoid RegExp.prototype.test in crypto error assertion --- test/parallel/test-crypto-no-algorithm.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-crypto-no-algorithm.js b/test/parallel/test-crypto-no-algorithm.js index bb5b81e119c87d..0497cc71dec259 100644 --- a/test/parallel/test-crypto-no-algorithm.js +++ b/test/parallel/test-crypto-no-algorithm.js @@ -22,8 +22,9 @@ if (isMainThread) { if (err) { assert.match(err.message, /digital envelope routines::unsupported/); const expected = /random number generator::unable to fetch drbg/; - assert(err.opensslErrorStack.some((msg) => expected.test(msg)), - `did not find ${expected} in ${err.opensslErrorStack}`); + assert( + err.opensslErrorStack.some((msg) => msg.match(expected)), + `did not find ${expected} in ${err.opensslErrorStack}`); } })); }