summaryrefslogtreecommitdiff
path: root/tests/unit/fetch_test.ts
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2024-09-10 20:12:24 +0200
committerGitHub <noreply@github.com>2024-09-10 11:12:24 -0700
commit7bfcb4dd10d31f5f9566c90a28449c0951f3a48e (patch)
treefca0dec6e98118418f1712c6e8451a04c7e89988 /tests/unit/fetch_test.ts
parentbe5419d479fcae16c8a07dec00ce11b532b7996a (diff)
feat(cli): use NotCapable error for permission errors (#25431)
Closes #7394 --------- Co-authored-by: snek <snek@deno.com>
Diffstat (limited to 'tests/unit/fetch_test.ts')
-rw-r--r--tests/unit/fetch_test.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/unit/fetch_test.ts b/tests/unit/fetch_test.ts
index 35d5e563f..35517911c 100644
--- a/tests/unit/fetch_test.ts
+++ b/tests/unit/fetch_test.ts
@@ -124,7 +124,7 @@ Deno.test({ permissions: { net: true } }, async function fetchJsonSuccess() {
Deno.test({ permissions: { net: false } }, async function fetchPerm() {
await assertRejects(async () => {
await fetch("http://localhost:4545/assets/fixture.json");
- }, Deno.errors.PermissionDenied);
+ }, Deno.errors.NotCapable);
});
Deno.test({ permissions: { net: true } }, async function fetchUrl() {
@@ -1637,7 +1637,7 @@ Deno.test(
Deno.test({ permissions: { read: false } }, async function fetchFilePerm() {
await assertRejects(async () => {
await fetch(import.meta.resolve("../testdata/subdir/json_1.json"));
- }, Deno.errors.PermissionDenied);
+ }, Deno.errors.NotCapable);
});
Deno.test(
@@ -1645,7 +1645,7 @@ Deno.test(
async function fetchFilePermDoesNotExist() {
await assertRejects(async () => {
await fetch(import.meta.resolve("./bad.json"));
- }, Deno.errors.PermissionDenied);
+ }, Deno.errors.NotCapable);
},
);