Skip to content

Commit a0f6e1e

Browse files
committed
test: fixed assert.throws regular expressions
1 parent 5049fe6 commit a0f6e1e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/pummel/test-crypto-dh.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ assert.throws(
2020
function() {
2121
crypto.getDiffieHellman('modp1').setPrivateKey('');
2222
},
23-
/^TypeError: crypto\.getDiffieHellman\(\.\.\.\)\.setPrivateKey/ +
24-
/ is not a function$/,
23+
new RegExp(/^TypeError: crypto\.getDiffieHellman\(\.\.\.\)\./.source +
24+
/setPrivateKey is not a function$/.source),
2525
'crypto.getDiffieHellman(\'modp1\').setPrivateKey(\'\') ' +
2626
'failed to throw the expected error.'
2727
);
2828
assert.throws(
2929
function() {
3030
crypto.getDiffieHellman('modp1').setPublicKey('');
3131
},
32-
/^TypeError: crypto\.getDiffieHellman\(\.\.\.\)\.setPublicKey/ +
33-
/ is not a function$/,
32+
new RegExp(/^TypeError: crypto\.getDiffieHellman\(\.\.\.\)\./.source +
33+
/setPublicKey is not a function$/.source),
3434
'crypto.getDiffieHellman(\'modp1\').setPublicKey(\'\') ' +
3535
'failed to throw the expected error.'
3636
);

0 commit comments

Comments
 (0)