diff options
author | James M Snell <jasnell@gmail.com> | 2017-09-06 08:10:34 -0700 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-09-18 08:10:59 -0700 |
commit | c75f87cc4c8d3699e081d37bb5bf47a70d830fdb (patch) | |
tree | 9d79319f568ff43e36e05a8d2634130adfacfb74 /test/parallel/test-crypto-binary-default.js | |
parent | 8fa5fcc0ba74c23490c34da1a6c6e9a454280740 (diff) | |
download | android-node-v8-c75f87cc4c8d3699e081d37bb5bf47a70d830fdb.tar.gz android-node-v8-c75f87cc4c8d3699e081d37bb5bf47a70d830fdb.tar.bz2 android-node-v8-c75f87cc4c8d3699e081d37bb5bf47a70d830fdb.zip |
crypto: refactor the crypto module
* Split single monolithic file into multiple
* Make Certificate methods static
* Allow randomFill(Sync) to use any ArrayBufferView
* Use internal/errors throughout
* Improve arg validation in Hash/Hmac
* Doc updates
PR-URL: https://github.com/nodejs/node/pull/15231
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Diffstat (limited to 'test/parallel/test-crypto-binary-default.js')
-rw-r--r-- | test/parallel/test-crypto-binary-default.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/parallel/test-crypto-binary-default.js b/test/parallel/test-crypto-binary-default.js index 0350015dc6..dbf814ff4b 100644 --- a/test/parallel/test-crypto-binary-default.js +++ b/test/parallel/test-crypto-binary-default.js @@ -568,9 +568,12 @@ testCipher4(Buffer.from('0123456789abcd0123456789'), Buffer.from('12345678')); // update() should only take buffers / strings -assert.throws(function() { - crypto.createHash('sha1').update({ foo: 'bar' }); -}, /^TypeError: Data must be a string or a buffer$/); +common.expectsError( + () => crypto.createHash('sha1').update({ foo: 'bar' }), + { + code: 'ERR_INVALID_ARG_TYPE', + type: TypeError + }); // Test Diffie-Hellman with two parties sharing a secret, |