diff options
| author | Vincent LE GOFF <g_n_s@hotmail.fr> | 2019-04-24 13:41:23 +0200 |
|---|---|---|
| committer | Ryan Dahl <ry@tinyclouds.org> | 2019-04-24 07:41:22 -0400 |
| commit | dcd01dd02530df0e799eb4227087680ffeb80d74 (patch) | |
| tree | 8cc1dec75dd17c326fea6d7fe471b7e7a31032f7 /fs/read_json_test.ts | |
| parent | e1f7a60bb326f8299f339635c0738d28431afa0a (diff) | |
Eslint fixes (denoland/deno_std#356)
Make warnings fail
Original: https://github.com/denoland/deno_std/commit/4543b563a9a01c8c168aafcbfd9d4634effba7fc
Diffstat (limited to 'fs/read_json_test.ts')
| -rw-r--r-- | fs/read_json_test.ts | 72 |
1 files changed, 42 insertions, 30 deletions
diff --git a/fs/read_json_test.ts b/fs/read_json_test.ts index ca32ee053..c8aa6dcf1 100644 --- a/fs/read_json_test.ts +++ b/fs/read_json_test.ts @@ -10,31 +10,37 @@ import * as path from "./path/mod.ts"; const testdataDir = path.resolve("fs", "testdata"); -test(async function readJsonFileNotExists() { +test(async function readJsonFileNotExists(): Promise<void> { const emptyJsonFile = path.join(testdataDir, "json_not_exists.json"); - await assertThrowsAsync(async () => { - await readJson(emptyJsonFile); - }); + await assertThrowsAsync( + async (): Promise<void> => { + await readJson(emptyJsonFile); + } + ); }); -test(async function readEmptyJsonFile() { +test(async function readEmptyJsonFile(): Promise<void> { const emptyJsonFile = path.join(testdataDir, "json_empty.json"); - await assertThrowsAsync(async () => { - await readJson(emptyJsonFile); - }); + await assertThrowsAsync( + async (): Promise<void> => { + await readJson(emptyJsonFile); + } + ); }); -test(async function readInvalidJsonFile() { +test(async function readInvalidJsonFile(): Promise<void> { const invalidJsonFile = path.join(testdataDir, "json_invalid.json"); - await assertThrowsAsync(async () => { - await readJson(invalidJsonFile); - }); + await assertThrowsAsync( + async (): Promise<void> => { + await readJson(invalidJsonFile); + } + ); }); -test(async function readValidArrayJsonFile() { +test(async function readValidArrayJsonFile(): Promise<void> { const invalidJsonFile = path.join(testdataDir, "json_valid_array.json"); const json = await readJson(invalidJsonFile); @@ -42,7 +48,7 @@ test(async function readValidArrayJsonFile() { assertEquals(json, ["1", "2", "3"]); }); -test(async function readValidObjJsonFile() { +test(async function readValidObjJsonFile(): Promise<void> { const invalidJsonFile = path.join(testdataDir, "json_valid_obj.json"); const json = await readJson(invalidJsonFile); @@ -50,37 +56,43 @@ test(async function readValidObjJsonFile() { assertEquals(json, { key1: "value1", key2: "value2" }); }); -test(async function readValidObjJsonFileWithRelativePath() { +test(async function readValidObjJsonFileWithRelativePath(): Promise<void> { const json = await readJson("./fs/testdata/json_valid_obj.json"); assertEquals(json, { key1: "value1", key2: "value2" }); }); -test(function readJsonFileNotExistsSync() { +test(function readJsonFileNotExistsSync(): void { const emptyJsonFile = path.join(testdataDir, "json_not_exists.json"); - assertThrows(() => { - readJsonSync(emptyJsonFile); - }); + assertThrows( + (): void => { + readJsonSync(emptyJsonFile); + } + ); }); -test(function readEmptyJsonFileSync() { +test(function readEmptyJsonFileSync(): void { const emptyJsonFile = path.join(testdataDir, "json_empty.json"); - assertThrows(() => { - readJsonSync(emptyJsonFile); - }); + assertThrows( + (): void => { + readJsonSync(emptyJsonFile); + } + ); }); -test(function readInvalidJsonFile() { +test(function readInvalidJsonFile(): void { const invalidJsonFile = path.join(testdataDir, "json_invalid.json"); - assertThrows(() => { - readJsonSync(invalidJsonFile); - }); + assertThrows( + (): void => { + readJsonSync(invalidJsonFile); + } + ); }); -test(function readValidArrayJsonFileSync() { +test(function readValidArrayJsonFileSync(): void { const invalidJsonFile = path.join(testdataDir, "json_valid_array.json"); const json = readJsonSync(invalidJsonFile); @@ -88,7 +100,7 @@ test(function readValidArrayJsonFileSync() { assertEquals(json, ["1", "2", "3"]); }); -test(function readValidObjJsonFileSync() { +test(function readValidObjJsonFileSync(): void { const invalidJsonFile = path.join(testdataDir, "json_valid_obj.json"); const json = readJsonSync(invalidJsonFile); @@ -96,7 +108,7 @@ test(function readValidObjJsonFileSync() { assertEquals(json, { key1: "value1", key2: "value2" }); }); -test(function readValidObjJsonFileSyncWithRelativePath() { +test(function readValidObjJsonFileSyncWithRelativePath(): void { const json = readJsonSync("./fs/testdata/json_valid_obj.json"); assertEquals(json, { key1: "value1", key2: "value2" }); |
