summaryrefslogtreecommitdiff
path: root/cli/tests/unit/webcrypto_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit/webcrypto_test.ts')
-rw-r--r--cli/tests/unit/webcrypto_test.ts13
1 files changed, 4 insertions, 9 deletions
diff --git a/cli/tests/unit/webcrypto_test.ts b/cli/tests/unit/webcrypto_test.ts
index 7a2bed758..639c623f9 100644
--- a/cli/tests/unit/webcrypto_test.ts
+++ b/cli/tests/unit/webcrypto_test.ts
@@ -1,9 +1,4 @@
-import {
- assert,
- assertEquals,
- assertThrowsAsync,
- unitTest,
-} from "./test_util.ts";
+import { assert, assertEquals, assertRejects, unitTest } from "./test_util.ts";
// https://github.com/denoland/deno/issues/11664
unitTest(async function testImportArrayBufferKey() {
@@ -141,7 +136,7 @@ unitTest(async function testEncryptDecrypt() {
const badPlainText = new Uint8Array(plainText.byteLength + 1);
badPlainText.set(plainText, 0);
badPlainText.set(new Uint8Array([32]), plainText.byteLength);
- await assertThrowsAsync(async () => {
+ await assertRejects(async () => {
// Should fail
await subtle.encrypt(
encryptAlgorithm,
@@ -232,7 +227,7 @@ unitTest(async function testECDSASignVerifyFail() {
const encoded = new Uint8Array([1]);
// Signing with a public key (InvalidAccessError)
- await assertThrowsAsync(async () => {
+ await assertRejects(async () => {
await window.crypto.subtle.sign(
{ name: "ECDSA", hash: "SHA-384" },
key.publicKey,
@@ -249,7 +244,7 @@ unitTest(async function testECDSASignVerifyFail() {
);
// Verifying with a private key (InvalidAccessError)
- await assertThrowsAsync(async () => {
+ await assertRejects(async () => {
await window.crypto.subtle.verify(
{ hash: { name: "SHA-384" }, name: "ECDSA" },
key.privateKey,