diff options
Diffstat (limited to 'std/node/_fs/_fs_writeFile_test.ts')
-rw-r--r-- | std/node/_fs/_fs_writeFile_test.ts | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/std/node/_fs/_fs_writeFile_test.ts b/std/node/_fs/_fs_writeFile_test.ts index 015ed6553..a11e0fb67 100644 --- a/std/node/_fs/_fs_writeFile_test.ts +++ b/std/node/_fs/_fs_writeFile_test.ts @@ -18,7 +18,7 @@ Deno.test("Callback must be a function error", function fn() { writeFile("some/path", "some data", "utf8"); }, TypeError, - "Callback must be a function." + "Callback must be a function.", ); }); @@ -29,7 +29,7 @@ Deno.test("Invalid encoding results in error()", function testEncodingErrors() { writeFile("some/path", "some data", "made-up-encoding", () => {}); }, Error, - `The value "made-up-encoding" is invalid for option "encoding"` + `The value "made-up-encoding" is invalid for option "encoding"`, ); assertThrows( @@ -38,7 +38,7 @@ Deno.test("Invalid encoding results in error()", function testEncodingErrors() { writeFileSync("some/path", "some data", "made-up-encoding"); }, Error, - `The value "made-up-encoding" is invalid for option "encoding"` + `The value "made-up-encoding" is invalid for option "encoding"`, ); assertThrows( @@ -50,11 +50,11 @@ Deno.test("Invalid encoding results in error()", function testEncodingErrors() { // @ts-expect-error Type '"made-up-encoding"' is not assignable to type encoding: "made-up-encoding", }, - () => {} + () => {}, ); }, Error, - `The value "made-up-encoding" is invalid for option "encoding"` + `The value "made-up-encoding" is invalid for option "encoding"`, ); assertThrows( @@ -65,7 +65,7 @@ Deno.test("Invalid encoding results in error()", function testEncodingErrors() { }); }, Error, - `The value "made-up-encoding" is invalid for option "encoding"` + `The value "made-up-encoding" is invalid for option "encoding"`, ); }); @@ -77,7 +77,7 @@ Deno.test( writeFile("some/path", "some data", "utf16le", () => {}); }, Error, - `Not implemented: "utf16le" encoding` + `Not implemented: "utf16le" encoding`, ); assertThrows( @@ -85,9 +85,9 @@ Deno.test( writeFileSync("some/path", "some data", "utf16le"); }, Error, - `Not implemented: "utf16le" encoding` + `Not implemented: "utf16le" encoding`, ); - } + }, ); Deno.test( @@ -111,7 +111,7 @@ Deno.test( const data = await Deno.readFile(tempFile); await Deno.remove(tempFile); assertEquals(decoder.decode(data), "hello world"); - } + }, ); Deno.test( @@ -125,7 +125,7 @@ Deno.test( await Deno.remove("_fs_writeFile_test_file.txt"); assertEquals(res, null); assertEquals(decoder.decode(data), "hello world"); - } + }, ); Deno.test( @@ -146,7 +146,7 @@ Deno.test( "_fs_writeFile_test_file.txt", value, encoding as TextEncodings, - resolve + resolve, ); }); @@ -155,7 +155,7 @@ Deno.test( assertEquals(res, null); assertEquals(decoder.decode(data), "hello world"); } - } + }, ); Deno.test("Path can be an URL", async function testCorrectWriteUsingURL() { @@ -165,7 +165,7 @@ Deno.test("Path can be an URL", async function testCorrectWriteUsingURL() { path .join(testDataDir, "_fs_writeFile_test_file_url.txt") .replace(/\\/g, "/") - : "file://" + path.join(testDataDir, "_fs_writeFile_test_file_url.txt") + : "file://" + path.join(testDataDir, "_fs_writeFile_test_file_url.txt"), ); const filePath = path.fromFileUrl(url); const res = await new Promise((resolve) => { @@ -218,7 +218,7 @@ Deno.test( await Deno.remove(filename); assert(fileInfo.mode); assertNotEquals(fileInfo.mode & 0o777, 0o777); - } + }, ); Deno.test( @@ -237,7 +237,7 @@ Deno.test( const data = Deno.readFileSync(tempFile); Deno.removeSync(tempFile); assertEquals(decoder.decode(data), "hello world"); - } + }, ); Deno.test( @@ -260,7 +260,7 @@ Deno.test( Deno.removeSync(file); assertEquals(decoder.decode(data), "hello world"); } - } + }, ); Deno.test( @@ -273,18 +273,18 @@ Deno.test( const data = Deno.readFileSync(file); Deno.removeSync(file); assertEquals(decoder.decode(data), "hello world"); - } + }, ); Deno.test("sync: Path can be an URL", function testCorrectWriteSyncUsingURL() { const filePath = path.join( testDataDir, - "_fs_writeFileSync_test_file_url.txt" + "_fs_writeFileSync_test_file_url.txt", ); const url = new URL( Deno.build.os === "windows" ? "file:///" + filePath.replace(/\\/g, "/") - : "file://" + filePath + : "file://" + filePath, ); writeFileSync(url, "hello world"); @@ -305,5 +305,5 @@ Deno.test( Deno.removeSync(filename); assert(fileInfo && fileInfo.mode); assertEquals(fileInfo.mode & 0o777, 0o777); - } + }, ); |