0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-30 09:08:00 -04:00
denoland-deno/std/fs/read_file_str_test.ts
Bartek Iwańczuk 8feb30e325
BREAKING: remove overload of Deno.test() (#4951)
This commit removes overload of Deno.test() that accepted named
function.
2020-04-28 12:33:09 +02:00

19 lines
691 B
TypeScript

import { assert } from "../testing/asserts.ts";
import * as path from "../path/mod.ts";
import { readFileStrSync, readFileStr } from "./read_file_str.ts";
const testdataDir = path.resolve("fs", "testdata");
Deno.test("testReadFileSync", function (): void {
const jsonFile = path.join(testdataDir, "json_valid_obj.json");
const strFile = readFileStrSync(jsonFile);
assert(typeof strFile === "string");
assert(strFile.length > 0);
});
Deno.test("testReadFile", async function (): Promise<void> {
const jsonFile = path.join(testdataDir, "json_valid_obj.json");
const strFile = await readFileStr(jsonFile);
assert(typeof strFile === "string");
assert(strFile.length > 0);
});