std/fs/read_file_str_test.ts
Vincent LE GOFF 4543b563a9 Eslint fixes (#356)
Make warnings fail
2019-04-24 07:41:22 -04:00

21 lines
714 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(): void {
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(): Promise<void> {
const jsonFile = path.join(testdataDir, "json_valid_obj.json");
const strFile = await readFileStr(jsonFile);
assert(typeof strFile === "string");
assert(strFile.length > 0);
});