From 5047006980a4f1dbe2ee27f800fe77ecc62a02a5 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Wed, 19 Jun 2019 05:18:02 +0200 Subject: [PATCH] test: use regex for OpenSSL function name This commit modifies test-crypt-scrypt.js to use a regular expression for the function name in the error message, similar to what is done for the error code. The motivation for this change comes from a case where we (Red Hat) patch OpenSSL and the memory limit checking is done in a different function, meaning that the function name from which this error originates differs from that when linking to the OpenSSL version shipped with Node.js. PR-URL: https://github.com/nodejs/node/pull/28289 Reviewed-By: Sam Roberts Reviewed-By: Anna Henningsen Reviewed-By: Ben Noordhuis --- test/parallel/test-crypto-scrypt.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-crypto-scrypt.js b/test/parallel/test-crypto-scrypt.js index e1d0ddf10c98f4..7c7f089606b852 100644 --- a/test/parallel/test-crypto-scrypt.js +++ b/test/parallel/test-crypto-scrypt.js @@ -169,7 +169,8 @@ for (const options of bad) { for (const options of toobig) { const expected = { - message: /error:[^:]+:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded/, + message: new RegExp('error:[^:]+:digital envelope routines:' + + '(?:EVP_PBE_scrypt|scrypt_alg):memory limit exceeded'), type: Error, }; common.expectsError(() => crypto.scrypt('pass', 'salt', 1, options, () => {}),