summaryrefslogtreecommitdiff
path: root/test/parallel/test-crypto-hmac.js
diff options
context:
space:
mode:
authorSam Roberts <vieuxtech@gmail.com>2018-12-13 13:39:26 -0800
committerRich Trott <rtrott@gmail.com>2018-12-16 21:29:15 -0800
commitb54d4a68e3967f0e106af520ccd95dbc375fbf22 (patch)
tree2f2e4d82b2e0ba4d89d03aa976c4b12e0eaac997 /test/parallel/test-crypto-hmac.js
parent3439c955abaeab503a4adf563ac5ed940665fe25 (diff)
downloadandroid-node-v8-b54d4a68e3967f0e106af520ccd95dbc375fbf22.tar.gz
android-node-v8-b54d4a68e3967f0e106af520ccd95dbc375fbf22.tar.bz2
android-node-v8-b54d4a68e3967f0e106af520ccd95dbc375fbf22.zip
test: merge test with unnecessary child process
Test didn't require child process creation. While this test has not been unstable, child process creation is slower and can be flaky in ci, so test directly for the segfault regression. PR-URL: https://github.com/nodejs/node/pull/25025 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Diffstat (limited to 'test/parallel/test-crypto-hmac.js')
-rw-r--r--test/parallel/test-crypto-hmac.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/parallel/test-crypto-hmac.js b/test/parallel/test-crypto-hmac.js
index 223b5c3c07..f21db29d36 100644
--- a/test/parallel/test-crypto-hmac.js
+++ b/test/parallel/test-crypto-hmac.js
@@ -21,6 +21,16 @@ common.expectsError(
message: 'The "hmac" argument must be of type string. Received type object'
});
+// This used to segfault. See: https://github.com/nodejs/node/issues/9819
+common.expectsError(
+ () => crypto.createHmac('sha256', 'key').digest({
+ toString: () => { throw new Error('boom'); },
+ }),
+ {
+ type: Error,
+ message: 'boom'
+ });
+
common.expectsError(
() => crypto.createHmac('sha1', null),
{