summaryrefslogtreecommitdiff
path: root/fs/empty_dir_test.ts
diff options
context:
space:
mode:
authorVincent LE GOFF <g_n_s@hotmail.fr>2019-04-24 13:41:23 +0200
committerRyan Dahl <ry@tinyclouds.org>2019-04-24 07:41:22 -0400
commitdcd01dd02530df0e799eb4227087680ffeb80d74 (patch)
tree8cc1dec75dd17c326fea6d7fe471b7e7a31032f7 /fs/empty_dir_test.ts
parente1f7a60bb326f8299f339635c0738d28431afa0a (diff)
Eslint fixes (denoland/deno_std#356)
Make warnings fail Original: https://github.com/denoland/deno_std/commit/4543b563a9a01c8c168aafcbfd9d4634effba7fc
Diffstat (limited to 'fs/empty_dir_test.ts')
-rw-r--r--fs/empty_dir_test.ts40
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 });