mirror of
https://github.com/denoland/deno.git
synced 2024-12-25 16:49:18 -05:00
99cedf40e7
Original: b462ad2530
20 lines
693 B
TypeScript
20 lines
693 B
TypeScript
import { test } from "../testing/mod.ts";
|
|
import { assert } from "../testing/asserts.ts";
|
|
import { readFileStrSync, readFileStr } from "./read_file_str.ts";
|
|
import * as path from "./path/mod.ts";
|
|
|
|
const testdataDir = path.resolve("fs", "testdata");
|
|
|
|
test(function testReadFileSync() {
|
|
const jsonFile = path.join(testdataDir, "json_valid_obj.json");
|
|
const strFile = readFileStrSync(jsonFile);
|
|
assert(typeof strFile === "string");
|
|
assert(strFile.length > 0);
|
|
});
|
|
|
|
test(async function testReadFile() {
|
|
const jsonFile = path.join(testdataDir, "json_valid_obj.json");
|
|
const strFile = await readFileStr(jsonFile);
|
|
assert(typeof strFile === "string");
|
|
assert(strFile.length > 0);
|
|
});
|