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/write_text_file_test.ts | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'cli/tests/unit/write_text_file_test.ts') diff --git a/cli/tests/unit/write_text_file_test.ts b/cli/tests/unit/write_text_file_test.ts index f41f8f663..2d14dc712 100644 --- a/cli/tests/unit/write_text_file_test.ts +++ b/cli/tests/unit/write_text_file_test.ts @@ -8,7 +8,7 @@ import { unitTest( { perms: { read: true, write: true } }, - function writeTextFileSyncSuccess(): void { + function writeTextFileSyncSuccess() { const filename = Deno.makeTempDirSync() + "/test.txt"; Deno.writeTextFileSync(filename, "Hello"); const dataRead = Deno.readTextFileSync(filename); @@ -18,7 +18,7 @@ unitTest( unitTest( { perms: { read: true, write: true } }, - function writeTextFileSyncByUrl(): void { + function writeTextFileSyncByUrl() { const tempDir = Deno.makeTempDirSync(); const fileUrl = new URL( `file://${Deno.build.os === "windows" ? "/" : ""}${tempDir}/test.txt`, @@ -31,7 +31,7 @@ unitTest( }, ); -unitTest({ perms: { write: true } }, function writeTextFileSyncFail(): void { +unitTest({ perms: { write: true } }, function writeTextFileSyncFail() { const filename = "/baddir/test.txt"; // The following should fail because /baddir doesn't exist (hopefully). assertThrows(() => { @@ -39,7 +39,7 @@ unitTest({ perms: { write: true } }, function writeTextFileSyncFail(): void { }, Deno.errors.NotFound); }); -unitTest({ perms: { write: false } }, function writeTextFileSyncPerm(): void { +unitTest({ perms: { write: false } }, function writeTextFileSyncPerm() { const filename = "/baddir/test.txt"; // The following should fail due to no write permission assertThrows(() => { @@ -49,7 +49,7 @@ unitTest({ perms: { write: false } }, function writeTextFileSyncPerm(): void { unitTest( { perms: { read: true, write: true } }, - function writeTextFileSyncUpdateMode(): void { + function writeTextFileSyncUpdateMode() { if (Deno.build.os !== "windows") { const data = "Hello"; const filename = Deno.makeTempDirSync() + "/test.txt"; @@ -63,7 +63,7 @@ unitTest( unitTest( { perms: { read: true, write: true } }, - function writeTextFileSyncCreate(): void { + function writeTextFileSyncCreate() { const data = "Hello"; const filename = Deno.makeTempDirSync() + "/test.txt"; let caughtError = false; @@ -85,7 +85,7 @@ unitTest( unitTest( { perms: { read: true, write: true } }, - function writeTextFileSyncAppend(): void { + function writeTextFileSyncAppend() { const data = "Hello"; const filename = Deno.makeTempDirSync() + "/test.txt"; Deno.writeTextFileSync(filename, data); @@ -102,7 +102,7 @@ unitTest( unitTest( { perms: { read: true, write: true } }, - async function writeTextFileSuccess(): Promise { + async function writeTextFileSuccess() { const filename = Deno.makeTempDirSync() + "/test.txt"; await Deno.writeTextFile(filename, "Hello"); const dataRead = Deno.readTextFileSync(filename); @@ -112,7 +112,7 @@ unitTest( unitTest( { perms: { read: true, write: true } }, - async function writeTextFileByUrl(): Promise { + async function writeTextFileByUrl() { const tempDir = Deno.makeTempDirSync(); const fileUrl = new URL( `file://${Deno.build.os === "windows" ? "/" : ""}${tempDir}/test.txt`, @@ -127,7 +127,7 @@ unitTest( unitTest( { perms: { read: true, write: true } }, - async function writeTextFileNotFound(): Promise { + async function writeTextFileNotFound() { const filename = "/baddir/test.txt"; // The following should fail because /baddir doesn't exist (hopefully). await assertThrowsAsync(async () => { @@ -138,7 +138,7 @@ unitTest( unitTest( { perms: { write: false } }, - async function writeTextFilePerm(): Promise { + async function writeTextFilePerm() { const filename = "/baddir/test.txt"; // The following should fail due to no write permission await assertThrowsAsync(async () => { @@ -149,7 +149,7 @@ unitTest( unitTest( { perms: { read: true, write: true } }, - async function writeTextFileUpdateMode(): Promise { + async function writeTextFileUpdateMode() { if (Deno.build.os !== "windows") { const data = "Hello"; const filename = Deno.makeTempDirSync() + "/test.txt"; @@ -163,7 +163,7 @@ unitTest( unitTest( { perms: { read: true, write: true } }, - async function writeTextFileCreate(): Promise { + async function writeTextFileCreate() { const data = "Hello"; const filename = Deno.makeTempDirSync() + "/test.txt"; let caughtError = false; @@ -185,7 +185,7 @@ unitTest( unitTest( { perms: { read: true, write: true } }, - async function writeTextFileAppend(): Promise { + async function writeTextFileAppend() { const data = "Hello"; const filename = Deno.makeTempDirSync() + "/test.txt"; await Deno.writeTextFile(filename, data); -- cgit v1.2.3