diff options
Diffstat (limited to 'cli/tests/unit/write_text_file_test.ts')
-rw-r--r-- | cli/tests/unit/write_text_file_test.ts | 28 |
1 files changed, 14 insertions, 14 deletions
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<void> { + 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<void> { + 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<void> { + 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<void> { + 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<void> { + 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<void> { + 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<void> { + async function writeTextFileAppend() { const data = "Hello"; const filename = Deno.makeTempDirSync() + "/test.txt"; await Deno.writeTextFile(filename, data); |