| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6abfcd5 commit cd3e17e
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,15 +9,32 @@ try { | |||
| 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 | + /^Error: Unknown group$/, | ||
| 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', | |
| Back | FazBrowse Home | New Git URL |
0 commit comments