| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e0868aa commit 13b7856
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,15 +8,32 @@ if (!common.hasCrypto) { | |||
| 8 | 8 | return; | |
| 9 | 9 | } | |
| 10 | 10 | ||
| 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 | + /^Error: Unknown group$/, | ||
| 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 | + ); | ||
| 20 | 37 | ||
| 21 | 38 | var hashes = { | |
| 22 | 39 | modp1: '630e9acd2cc63f7e80d8507624ba60ac0757201a', | |
| Back | FazBrowse Home | New Git URL |
0 commit comments