summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/unit/read_file_test.ts22
1 files changed, 22 insertions, 0 deletions
diff --git a/cli/tests/unit/read_file_test.ts b/cli/tests/unit/read_file_test.ts
index 5f8ee2c11..d8d1cddf2 100644
--- a/cli/tests/unit/read_file_test.ts
+++ b/cli/tests/unit/read_file_test.ts
@@ -95,3 +95,25 @@ unitTest(
assertEquals(resourcesBefore, Deno.resources());
},
);
+
+unitTest(
+ { perms: { read: true } },
+ async function readFileWithAbortSignal(): Promise<void> {
+ const ac = new AbortController();
+ queueMicrotask(() => ac.abort());
+ await assertThrowsAsync(async () => {
+ await Deno.readFile("cli/tests/fixture.json", { signal: ac.signal });
+ });
+ },
+);
+
+unitTest(
+ { perms: { read: true } },
+ async function readTextileWithAbortSignal(): Promise<void> {
+ const ac = new AbortController();
+ queueMicrotask(() => ac.abort());
+ await assertThrowsAsync(async () => {
+ await Deno.readTextFile("cli/tests/fixture.json", { signal: ac.signal });
+ });
+ },
+);