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 9
9
return ;
10
10
}
11
11
12
- assert . throws ( function ( ) {
13
- crypto . getDiffieHellman ( 'unknown-group' ) ;
14
- } ) ;
15
- assert . throws ( function ( ) {
16
- crypto . getDiffieHellman ( 'modp1' ) . setPrivateKey ( '' ) ;
17
- } ) ;
18
- assert . throws ( function ( ) {
19
- crypto . getDiffieHellman ( 'modp1' ) . setPublicKey ( '' ) ;
20
- } ) ;
12
+ assert . throws (
13
+ function ( ) {
14
+ crypto . getDiffieHellman ( 'unknown-group' ) ;
15
+ } ,
16
+ / ^ E r r o r : U n k n o w n g r o u p $ / ,
17
+ 'crypto.getDiffieHellman(\'unknown-group\') ' +
18
+ 'failed to throw the expected error.'
19
+ ) ;
20
+ assert . throws (
21
+ function ( ) {
22
+ crypto . getDiffieHellman ( 'modp1' ) . setPrivateKey ( '' ) ;
23
+ } ,
24
+ new RegExp ( '^TypeError: crypto\\.getDiffieHellman\\(\\.\\.\\.\\)\\.' +
25
+ 'setPrivateKey is not a function$' ) ,
26
+ 'crypto.getDiffieHellman(\'modp1\').setPrivateKey(\'\') ' +
27
+ 'failed to throw the expected error.'
28
+ ) ;
29
+ assert . throws (
30
+ function ( ) {
31
+ crypto . getDiffieHellman ( 'modp1' ) . setPublicKey ( '' ) ;
32
+ } ,
33
+ new RegExp ( '^TypeError: crypto\\.getDiffieHellman\\(\\.\\.\\.\\)\\.' +
34
+ 'setPublicKey is not a function$' ) ,
35
+ 'crypto.getDiffieHellman(\'modp1\').setPublicKey(\'\') ' +
36
+ 'failed to throw the expected error.'
37
+ ) ;
21
38
22
39
var hashes = {
23
40
modp1 : '630e9acd2cc63f7e80d8507624ba60ac0757201a' ,
You can’t perform that action at this time.
0 commit comments