diff options
author | Leo K <crowlkats@toaxl.com> | 2021-08-05 13:08:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-05 13:08:58 +0200 |
commit | 3f0cf9619fce71a8898c495501df4bdb0e07e735 (patch) | |
tree | 1b8af2c832f8344f9a39f55326d576eab63f447f /cli/tests/unit/real_path_test.ts | |
parent | 299c7cfe54cb184e0d0c18b00a154c953b433ebf (diff) |
refactor(cli/tests): remove unnecessary void return types (#11577)
Diffstat (limited to 'cli/tests/unit/real_path_test.ts')
-rw-r--r-- | cli/tests/unit/real_path_test.ts | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/cli/tests/unit/real_path_test.ts b/cli/tests/unit/real_path_test.ts index 10e060578..b84b0c0df 100644 --- a/cli/tests/unit/real_path_test.ts +++ b/cli/tests/unit/real_path_test.ts @@ -9,7 +9,7 @@ import { unitTest, } from "./test_util.ts"; -unitTest({ perms: { read: true } }, function realPathSyncSuccess(): void { +unitTest({ perms: { read: true } }, function realPathSyncSuccess() { const relative = "cli/tests/fixture.json"; const realPath = Deno.realPathSync(relative); if (Deno.build.os !== "windows") { @@ -21,7 +21,7 @@ unitTest({ perms: { read: true } }, function realPathSyncSuccess(): void { } }); -unitTest({ perms: { read: true } }, function realPathSyncUrl(): void { +unitTest({ perms: { read: true } }, function realPathSyncUrl() { const relative = "cli/tests/fixture.json"; const url = pathToAbsoluteFileUrl(relative); assertEquals(Deno.realPathSync(relative), Deno.realPathSync(url)); @@ -31,7 +31,7 @@ unitTest( { perms: { read: true, write: true }, }, - function realPathSyncSymlink(): void { + function realPathSyncSymlink() { const testDir = Deno.makeTempDirSync(); const target = testDir + "/target"; const symlink = testDir + "/symln"; @@ -48,21 +48,19 @@ unitTest( }, ); -unitTest({ perms: { read: false } }, function realPathSyncPerm(): void { +unitTest({ perms: { read: false } }, function realPathSyncPerm() { assertThrows(() => { Deno.realPathSync("some_file"); }, Deno.errors.PermissionDenied); }); -unitTest({ perms: { read: true } }, function realPathSyncNotFound(): void { +unitTest({ perms: { read: true } }, function realPathSyncNotFound() { assertThrows(() => { Deno.realPathSync("bad_filename"); }, Deno.errors.NotFound); }); -unitTest({ perms: { read: true } }, async function realPathSuccess(): Promise< - void -> { +unitTest({ perms: { read: true } }, async function realPathSuccess() { const relativePath = "cli/tests/fixture.json"; const realPath = await Deno.realPath(relativePath); if (Deno.build.os !== "windows") { @@ -76,7 +74,7 @@ unitTest({ perms: { read: true } }, async function realPathSuccess(): Promise< unitTest( { perms: { read: true } }, - async function realPathUrl(): Promise<void> { + async function realPathUrl() { const relative = "cli/tests/fixture.json"; const url = pathToAbsoluteFileUrl(relative); assertEquals(await Deno.realPath(relative), await Deno.realPath(url)); @@ -87,7 +85,7 @@ unitTest( { perms: { read: true, write: true }, }, - async function realPathSymlink(): Promise<void> { + async function realPathSymlink() { const testDir = Deno.makeTempDirSync(); const target = testDir + "/target"; const symlink = testDir + "/symln"; @@ -104,17 +102,13 @@ unitTest( }, ); -unitTest({ perms: { read: false } }, async function realPathPerm(): Promise< - void -> { +unitTest({ perms: { read: false } }, async function realPathPerm() { await assertThrowsAsync(async () => { await Deno.realPath("some_file"); }, Deno.errors.PermissionDenied); }); -unitTest({ perms: { read: true } }, async function realPathNotFound(): Promise< - void -> { +unitTest({ perms: { read: true } }, async function realPathNotFound() { await assertThrowsAsync(async () => { await Deno.realPath("bad_filename"); }, Deno.errors.NotFound); |