diff options
Diffstat (limited to 'cli/js/tests/read_dir_test.ts')
-rw-r--r-- | cli/js/tests/read_dir_test.ts | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/cli/js/tests/read_dir_test.ts b/cli/js/tests/read_dir_test.ts index f1c7ea121..79e2a1507 100644 --- a/cli/js/tests/read_dir_test.ts +++ b/cli/js/tests/read_dir_test.ts @@ -14,15 +14,15 @@ function assertSameContent(files: Deno.DirEntry[]): void { assertEquals(counter, 1); } -unitTest({ perms: { read: true } }, function readdirSyncSuccess(): void { - const files = [...Deno.readdirSync("cli/tests/")]; +unitTest({ perms: { read: true } }, function readDirSyncSuccess(): void { + const files = [...Deno.readDirSync("cli/tests/")]; assertSameContent(files); }); -unitTest({ perms: { read: false } }, function readdirSyncPerm(): void { +unitTest({ perms: { read: false } }, function readDirSyncPerm(): void { let caughtError = false; try { - Deno.readdirSync("tests/"); + Deno.readDirSync("tests/"); } catch (e) { caughtError = true; assert(e instanceof Deno.errors.PermissionDenied); @@ -30,12 +30,12 @@ unitTest({ perms: { read: false } }, function readdirSyncPerm(): void { assert(caughtError); }); -unitTest({ perms: { read: true } }, function readdirSyncNotDir(): void { +unitTest({ perms: { read: true } }, function readDirSyncNotDir(): void { let caughtError = false; let src; try { - src = Deno.readdirSync("cli/tests/fixture.json"); + src = Deno.readDirSync("cli/tests/fixture.json"); } catch (err) { caughtError = true; assert(err instanceof Error); @@ -44,12 +44,12 @@ unitTest({ perms: { read: true } }, function readdirSyncNotDir(): void { assertEquals(src, undefined); }); -unitTest({ perms: { read: true } }, function readdirSyncNotFound(): void { +unitTest({ perms: { read: true } }, function readDirSyncNotFound(): void { let caughtError = false; let src; try { - src = Deno.readdirSync("bad_dir_name"); + src = Deno.readDirSync("bad_dir_name"); } catch (err) { caughtError = true; assert(err instanceof Deno.errors.NotFound); @@ -58,22 +58,22 @@ unitTest({ perms: { read: true } }, function readdirSyncNotFound(): void { assertEquals(src, undefined); }); -unitTest({ perms: { read: true } }, async function readdirSuccess(): Promise< +unitTest({ perms: { read: true } }, async function readDirSuccess(): Promise< void > { const files = []; - for await (const dirEntry of Deno.readdir("cli/tests/")) { + for await (const dirEntry of Deno.readDir("cli/tests/")) { files.push(dirEntry); } assertSameContent(files); }); -unitTest({ perms: { read: false } }, async function readdirPerm(): Promise< +unitTest({ perms: { read: false } }, async function readDirPerm(): Promise< void > { let caughtError = false; try { - await Deno.readdir("tests/")[Symbol.asyncIterator]().next(); + await Deno.readDir("tests/")[Symbol.asyncIterator]().next(); } catch (e) { caughtError = true; assert(e instanceof Deno.errors.PermissionDenied); |