File tree Expand file tree Collapse file tree 1 file changed +26
-9
lines changed Expand file tree Collapse file tree 1 file changed +26
-9
lines changed Original file line number Diff line number Diff line change @@ -8,15 +8,32 @@ if (!common.hasCrypto) {
88 return ;
99}
1010
11- assert . throws ( function ( ) {
12- crypto . getDiffieHellman ( 'unknown-group' ) ;
13- } ) ;
14- assert . throws ( function ( ) {
15- crypto . getDiffieHellman ( 'modp1' ) . setPrivateKey ( '' ) ;
16- } ) ;
17- assert . throws ( function ( ) {
18- crypto . getDiffieHellman ( 'modp1' ) . setPublicKey ( '' ) ;
19- } ) ;
11+ assert . throws (
12+ function ( ) {
13+ crypto . getDiffieHellman ( 'unknown-group' ) ;
14+ } ,
15+ / ^ E r r o r : U n k n o w n g r o u p $ / ,
16+ 'crypto.getDiffieHellman(\'unknown-group\') ' +
17+ 'failed to throw the expected error.'
18+ ) ;
19+ assert . throws (
20+ function ( ) {
21+ crypto . getDiffieHellman ( 'modp1' ) . setPrivateKey ( '' ) ;
22+ } ,
23+ new RegExp ( '^TypeError: crypto\\.getDiffieHellman\\(\\.\\.\\.\\)\\.' +
24+ 'setPrivateKey is not a function$' ) ,
25+ 'crypto.getDiffieHellman(\'modp1\').setPrivateKey(\'\') ' +
26+ 'failed to throw the expected error.'
27+ ) ;
28+ assert . throws (
29+ function ( ) {
30+ crypto . getDiffieHellman ( 'modp1' ) . setPublicKey ( '' ) ;
31+ } ,
32+ new RegExp ( '^TypeError: crypto\\.getDiffieHellman\\(\\.\\.\\.\\)\\.' +
33+ 'setPublicKey is not a function$' ) ,
34+ 'crypto.getDiffieHellman(\'modp1\').setPublicKey(\'\') ' +
35+ 'failed to throw the expected error.'
36+ ) ;
2037
2138const hashes = {
2239 modp1 : '630e9acd2cc63f7e80d8507624ba60ac0757201a' ,
You can’t perform that action at this time.
0 commit comments