refactor: rewrite tests in std/ to use Deno.test (#3930)

This commit is contained in:
Bartek Iwańczuk 2020-02-11 17:24:27 +01:00 committed by GitHub
parent e0bcecee60
commit 61273085e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
94 changed files with 328 additions and 1185 deletions

View file

@ -1,11 +1,10 @@
import { test } from "../testing/mod.ts";
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");
test(function testReadFileSync(): void {
Deno.test(function testReadFileSync(): void {
const jsonFile = path.join(testdataDir, "write_file_1.json");
const content = "write_file_str_test";
writeFileStrSync(jsonFile, content);
@ -21,7 +20,7 @@ test(function testReadFileSync(): void {
assertEquals(content, result);
});
test(async function testReadFile(): Promise<void> {
Deno.test(async function testReadFile(): Promise<void> {
const jsonFile = path.join(testdataDir, "write_file_2.json");
const content = "write_file_str_test";
await writeFileStr(jsonFile, content);