Skip to content

Commit 30d7f05

Browse files
juanarboljasnell
authored andcommitted
test: improve code coverage in webcrypto API
PR-URL: #38052 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 005ebaf commit 30d7f05

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/parallel/test-webcrypto-sign-verify-hmac.js

+7
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,13 @@ async function testSign({ hash,
152152
assert(await subtle.verify({ name, hash }, key, sig, plaintext));
153153
}
154154

155+
await assert.rejects(
156+
subtle.generateKey({ name }, false, []), {
157+
name: 'TypeError',
158+
code: 'ERR_MISSING_OPTION',
159+
message: 'algorithm.hash is required'
160+
});
161+
155162
// Test failure when no sign usage
156163
await assert.rejects(
157164
subtle.sign({ name, hash }, noSignKey, plaintext), {

0 commit comments

Comments
 (0)