test(std/fs): make tests runnable from any directory (#7388)

This commit is contained in:
Casper Beyer 2020-09-08 17:43:43 +08:00 committed by GitHub
parent 334ed0e2f4
commit c5d50737f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 18 additions and 9 deletions

View file

@ -9,7 +9,8 @@ import {
import * as path from "../path/mod.ts";
import { emptyDir, emptyDirSync } from "./empty_dir.ts";
const testdataDir = path.resolve("fs", "testdata");
const moduleDir = path.dirname(path.fromFileUrl(import.meta.url));
const testdataDir = path.resolve(moduleDir, "testdata");
Deno.test("emptyDirIfItNotExist", async function (): Promise<void> {
const testDir = path.join(testdataDir, "empty_dir_test_1");