diff options
author | Casper Beyer <caspervonb@pm.me> | 2020-07-23 09:34:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-22 21:34:20 -0400 |
commit | 843b54549c04337f18c62d1daf159a79865de6b7 (patch) | |
tree | 1b77a6ad95fa5d5e85f4a6db5a8b9f8ab00d8f49 /std/fs/write_file_str_test.ts | |
parent | b573bbe4471c3872f96e1d7b9d1d1a2b39ff4cf1 (diff) |
BREAKING(std/fs): remove writeFileStr and writeFileStrSync (#6847)
This removes the writeFileStr and writeFileStrSync functions which are
effectivly duplicates of Deno.writeTextFile and Deno.writeTextFileSync.
Diffstat (limited to 'std/fs/write_file_str_test.ts')
-rw-r--r-- | std/fs/write_file_str_test.ts | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/std/fs/write_file_str_test.ts b/std/fs/write_file_str_test.ts deleted file mode 100644 index 42119c8fb..000000000 --- a/std/fs/write_file_str_test.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { assertEquals } from "../testing/asserts.ts"; -import * as path from "../path/mod.ts"; -import { writeFileStr, writeFileStrSync } from "./write_file_str.ts"; - -const testdataDir = path.resolve("fs", "testdata"); - -Deno.test("testReadFileSync", function (): void { - const jsonFile = path.join(testdataDir, "write_file_1.json"); - const content = "write_file_str_test"; - writeFileStrSync(jsonFile, content); - - // make sure file have been create. - Deno.statSync(jsonFile); - - const result = new TextDecoder().decode(Deno.readFileSync(jsonFile)); - - // remove test file - Deno.removeSync(jsonFile); - - assertEquals(content, result); -}); - -Deno.test("testReadFile", async function (): Promise<void> { - const jsonFile = path.join(testdataDir, "write_file_2.json"); - const content = "write_file_str_test"; - await writeFileStr(jsonFile, content); - - // make sure file have been create. - await Deno.stat(jsonFile); - - const result = new TextDecoder().decode(await Deno.readFile(jsonFile)); - - // remove test file - await Deno.remove(jsonFile); - - assertEquals(content, result); -}); |