From 7bfcb4dd10d31f5f9566c90a28449c0951f3a48e Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Tue, 10 Sep 2024 20:12:24 +0200 Subject: feat(cli): use NotCapable error for permission errors (#25431) Closes #7394 --------- Co-authored-by: snek --- tests/unit/read_dir_test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/unit/read_dir_test.ts') diff --git a/tests/unit/read_dir_test.ts b/tests/unit/read_dir_test.ts index cba9647e5..b00495eb4 100644 --- a/tests/unit/read_dir_test.ts +++ b/tests/unit/read_dir_test.ts @@ -35,7 +35,7 @@ Deno.test({ permissions: { read: true } }, function readDirSyncWithUrl() { Deno.test({ permissions: { read: false } }, function readDirSyncPerm() { assertThrows(() => { Deno.readDirSync("tests/"); - }, Deno.errors.PermissionDenied); + }, Deno.errors.NotCapable); }); Deno.test({ permissions: { read: true } }, function readDirSyncNotDir() { @@ -79,7 +79,7 @@ Deno.test({ permissions: { read: true } }, async function readDirWithUrl() { Deno.test({ permissions: { read: false } }, async function readDirPerm() { await assertRejects(async () => { await Deno.readDir("tests/")[Symbol.asyncIterator]().next(); - }, Deno.errors.PermissionDenied); + }, Deno.errors.NotCapable); }); Deno.test( -- cgit v1.2.3