From 3f0cf9619fce71a8898c495501df4bdb0e07e735 Mon Sep 17 00:00:00 2001 From: Leo K Date: Thu, 5 Aug 2021 13:08:58 +0200 Subject: refactor(cli/tests): remove unnecessary void return types (#11577) --- cli/tests/unit/real_path_test.ts | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'cli/tests/unit/real_path_test.ts') 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 { + 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 { + 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); -- cgit v1.2.3