diff options
author | Casper Beyer <caspervonb@pm.me> | 2021-09-22 21:21:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-22 09:21:11 -0400 |
commit | 20692f3e844816d7d4a4f4fdfbfe30e416822350 (patch) | |
tree | fbecfd548b6bf479a663f79d80c45d61fc63125b /cli/tests/unit/webcrypto_test.ts | |
parent | 82cfb46bd1d64d41afda544bde9ef57096fb520b (diff) |
chore: replace calls to assertThrowsAsync with assertRejects (#12176)
Diffstat (limited to 'cli/tests/unit/webcrypto_test.ts')
-rw-r--r-- | cli/tests/unit/webcrypto_test.ts | 13 |
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, |