summaryrefslogtreecommitdiff
path: root/cli/tests/unit/write_text_file_test.ts
diff options
context:
space:
mode:
authorLeo K <crowlkats@toaxl.com>2021-08-05 13:08:58 +0200
committerGitHub <noreply@github.com>2021-08-05 13:08:58 +0200
commit3f0cf9619fce71a8898c495501df4bdb0e07e735 (patch)
tree1b8af2c832f8344f9a39f55326d576eab63f447f /cli/tests/unit/write_text_file_test.ts
parent299c7cfe54cb184e0d0c18b00a154c953b433ebf (diff)
refactor(cli/tests): remove unnecessary void return types (#11577)
Diffstat (limited to 'cli/tests/unit/write_text_file_test.ts')
-rw-r--r--cli/tests/unit/write_text_file_test.ts28
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);