diff options
author | Luca Casonato <hello@lcas.dev> | 2024-09-10 20:12:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-10 11:12:24 -0700 |
commit | 7bfcb4dd10d31f5f9566c90a28449c0951f3a48e (patch) | |
tree | fca0dec6e98118418f1712c6e8451a04c7e89988 /tests/unit/read_text_file_test.ts | |
parent | be5419d479fcae16c8a07dec00ce11b532b7996a (diff) |
feat(cli): use NotCapable error for permission errors (#25431)
Closes #7394
---------
Co-authored-by: snek <snek@deno.com>
Diffstat (limited to 'tests/unit/read_text_file_test.ts')
-rw-r--r-- | tests/unit/read_text_file_test.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/unit/read_text_file_test.ts b/tests/unit/read_text_file_test.ts index cab75fd47..1ec57bde3 100644 --- a/tests/unit/read_text_file_test.ts +++ b/tests/unit/read_text_file_test.ts @@ -28,7 +28,7 @@ Deno.test({ permissions: { read: true } }, function readTextFileSyncByUrl() { Deno.test({ permissions: { read: false } }, function readTextFileSyncPerm() { assertThrows(() => { Deno.readTextFileSync("tests/testdata/assets/fixture.json"); - }, Deno.errors.PermissionDenied); + }, Deno.errors.NotCapable); }); Deno.test({ permissions: { read: true } }, function readTextFileSyncNotFound() { @@ -61,7 +61,7 @@ Deno.test({ permissions: { read: true } }, async function readTextFileByUrl() { Deno.test({ permissions: { read: false } }, async function readTextFilePerm() { await assertRejects(async () => { await Deno.readTextFile("tests/testdata/assets/fixture.json"); - }, Deno.errors.PermissionDenied); + }, Deno.errors.NotCapable); }); Deno.test({ permissions: { read: true } }, function readTextFileSyncLoop() { |