summaryrefslogtreecommitdiff
path: root/cli/tests/unit/read_file_test.ts
diff options
context:
space:
mode:
authorCasper Beyer <caspervonb@pm.me>2021-09-22 21:21:11 +0800
committerGitHub <noreply@github.com>2021-09-22 09:21:11 -0400
commit20692f3e844816d7d4a4f4fdfbfe30e416822350 (patch)
treefbecfd548b6bf479a663f79d80c45d61fc63125b /cli/tests/unit/read_file_test.ts
parent82cfb46bd1d64d41afda544bde9ef57096fb520b (diff)
chore: replace calls to assertThrowsAsync with assertRejects (#12176)
Diffstat (limited to 'cli/tests/unit/read_file_test.ts')
-rw-r--r--cli/tests/unit/read_file_test.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/cli/tests/unit/read_file_test.ts b/cli/tests/unit/read_file_test.ts
index 7dd2b5621..8291877b4 100644
--- a/cli/tests/unit/read_file_test.ts
+++ b/cli/tests/unit/read_file_test.ts
@@ -2,8 +2,8 @@
import {
assert,
assertEquals,
+ assertRejects,
assertThrows,
- assertThrowsAsync,
pathToAbsoluteFileUrl,
unitTest,
} from "./test_util.ts";
@@ -61,7 +61,7 @@ unitTest({ perms: { read: true } }, async function readFileSuccess() {
});
unitTest({ perms: { read: false } }, async function readFilePerm() {
- await assertThrowsAsync(async () => {
+ await assertRejects(async () => {
await Deno.readFile("cli/tests/testdata/fixture.json");
}, Deno.errors.PermissionDenied);
});
@@ -76,7 +76,7 @@ unitTest(
{ perms: { read: true } },
async function readFileDoesNotLeakResources() {
const resourcesBefore = Deno.resources();
- await assertThrowsAsync(async () => await Deno.readFile("cli"));
+ await assertRejects(async () => await Deno.readFile("cli"));
assertEquals(resourcesBefore, Deno.resources());
},
);
@@ -95,7 +95,7 @@ unitTest(
async function readFileWithAbortSignal() {
const ac = new AbortController();
queueMicrotask(() => ac.abort());
- await assertThrowsAsync(async () => {
+ await assertRejects(async () => {
await Deno.readFile("cli/tests/testdata/fixture.json", {
signal: ac.signal,
});
@@ -108,7 +108,7 @@ unitTest(
async function readTextileWithAbortSignal() {
const ac = new AbortController();
queueMicrotask(() => ac.abort());
- await assertThrowsAsync(async () => {
+ await assertRejects(async () => {
await Deno.readTextFile("cli/tests/testdata/fixture.json", {
signal: ac.signal,
});