diff options
Diffstat (limited to 'fs/empty_dir_test.ts')
| -rw-r--r-- | fs/empty_dir_test.ts | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/fs/empty_dir_test.ts b/fs/empty_dir_test.ts index d91c497a7..b44e600d7 100644 --- a/fs/empty_dir_test.ts +++ b/fs/empty_dir_test.ts @@ -10,7 +10,7 @@ import * as path from "./path/mod.ts"; const testdataDir = path.resolve("fs", "testdata"); -test(async function emptyDirIfItNotExist() { +test(async function emptyDirIfItNotExist(): Promise<void> { const testDir = path.join(testdataDir, "empty_dir_test_1"); const testNestDir = path.join(testDir, "nest"); // empty a dir which not exist. then it will create new one @@ -26,7 +26,7 @@ test(async function emptyDirIfItNotExist() { } }); -test(function emptyDirSyncIfItNotExist() { +test(function emptyDirSyncIfItNotExist(): void { const testDir = path.join(testdataDir, "empty_dir_test_2"); const testNestDir = path.join(testDir, "nest"); // empty a dir which not exist. then it will create new one @@ -42,7 +42,7 @@ test(function emptyDirSyncIfItNotExist() { } }); -test(async function emptyDirIfItExist() { +test(async function emptyDirIfItExist(): Promise<void> { const testDir = path.join(testdataDir, "empty_dir_test_3"); const testNestDir = path.join(testDir, "nest"); // create test dir @@ -67,21 +67,25 @@ test(async function emptyDirIfItExist() { assertEquals(stat.isDirectory(), true); // nest directory have been remove - await assertThrowsAsync(async () => { - await Deno.stat(testNestDir); - }); + await assertThrowsAsync( + async (): Promise<void> => { + await Deno.stat(testNestDir); + } + ); // test file have been remove - await assertThrowsAsync(async () => { - await Deno.stat(testDirFile); - }); + await assertThrowsAsync( + async (): Promise<void> => { + await Deno.stat(testDirFile); + } + ); } finally { // remote test dir await Deno.remove(testDir, { recursive: true }); } }); -test(function emptyDirSyncIfItExist() { +test(function emptyDirSyncIfItExist(): void { const testDir = path.join(testdataDir, "empty_dir_test_4"); const testNestDir = path.join(testDir, "nest"); // create test dir @@ -106,14 +110,18 @@ test(function emptyDirSyncIfItExist() { assertEquals(stat.isDirectory(), true); // nest directory have been remove - assertThrows(() => { - Deno.statSync(testNestDir); - }); + assertThrows( + (): void => { + Deno.statSync(testNestDir); + } + ); // test file have been remove - assertThrows(() => { - Deno.statSync(testDirFile); - }); + assertThrows( + (): void => { + Deno.statSync(testDirFile); + } + ); } finally { // remote test dir Deno.removeSync(testDir, { recursive: true }); |
