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/chmod_test.ts | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'cli/tests/unit/chmod_test.ts') diff --git a/cli/tests/unit/chmod_test.ts b/cli/tests/unit/chmod_test.ts index 80f240134..5908ea09a 100644 --- a/cli/tests/unit/chmod_test.ts +++ b/cli/tests/unit/chmod_test.ts @@ -9,7 +9,7 @@ import { unitTest( { ignore: Deno.build.os === "windows", perms: { read: true, write: true } }, - function chmodSyncSuccess(): void { + function chmodSyncSuccess() { const enc = new TextEncoder(); const data = enc.encode("Hello"); const tempDir = Deno.makeTempDirSync(); @@ -26,7 +26,7 @@ unitTest( unitTest( { ignore: Deno.build.os === "windows", perms: { read: true, write: true } }, - function chmodSyncUrl(): void { + function chmodSyncUrl() { const enc = new TextEncoder(); const data = enc.encode("Hello"); const tempDir = Deno.makeTempDirSync(); @@ -49,7 +49,7 @@ unitTest( ignore: Deno.build.os === "windows", perms: { read: true, write: true }, }, - function chmodSyncSymlinkSuccess(): void { + function chmodSyncSymlinkSuccess() { const enc = new TextEncoder(); const data = enc.encode("Hello"); const tempDir = Deno.makeTempDirSync(); @@ -75,14 +75,14 @@ unitTest( }, ); -unitTest({ perms: { write: true } }, function chmodSyncFailure(): void { +unitTest({ perms: { write: true } }, function chmodSyncFailure() { assertThrows(() => { const filename = "/badfile.txt"; Deno.chmodSync(filename, 0o777); }, Deno.errors.NotFound); }); -unitTest({ perms: { write: false } }, function chmodSyncPerm(): void { +unitTest({ perms: { write: false } }, function chmodSyncPerm() { assertThrows(() => { Deno.chmodSync("/somefile.txt", 0o777); }, Deno.errors.PermissionDenied); @@ -90,7 +90,7 @@ unitTest({ perms: { write: false } }, function chmodSyncPerm(): void { unitTest( { ignore: Deno.build.os === "windows", perms: { read: true, write: true } }, - async function chmodSuccess(): Promise { + async function chmodSuccess() { const enc = new TextEncoder(); const data = enc.encode("Hello"); const tempDir = Deno.makeTempDirSync(); @@ -107,7 +107,7 @@ unitTest( unitTest( { ignore: Deno.build.os === "windows", perms: { read: true, write: true } }, - async function chmodUrl(): Promise { + async function chmodUrl() { const enc = new TextEncoder(); const data = enc.encode("Hello"); const tempDir = Deno.makeTempDirSync(); @@ -131,7 +131,7 @@ unitTest( ignore: Deno.build.os === "windows", perms: { read: true, write: true }, }, - async function chmodSymlinkSuccess(): Promise { + async function chmodSymlinkSuccess() { const enc = new TextEncoder(); const data = enc.encode("Hello"); const tempDir = Deno.makeTempDirSync(); @@ -157,18 +157,14 @@ unitTest( }, ); -unitTest({ perms: { write: true } }, async function chmodFailure(): Promise< - void -> { +unitTest({ perms: { write: true } }, async function chmodFailure() { await assertThrowsAsync(async () => { const filename = "/badfile.txt"; await Deno.chmod(filename, 0o777); }, Deno.errors.NotFound); }); -unitTest({ perms: { write: false } }, async function chmodPerm(): Promise< - void -> { +unitTest({ perms: { write: false } }, async function chmodPerm() { await assertThrowsAsync(async () => { await Deno.chmod("/somefile.txt", 0o777); }, Deno.errors.PermissionDenied); -- cgit v1.2.3