summaryrefslogtreecommitdiff
path: root/std/examples/test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'std/examples/test.ts')
-rw-r--r--std/examples/test.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/std/examples/test.ts b/std/examples/test.ts
index 20db3fb1d..a8ac8c74e 100644
--- a/std/examples/test.ts
+++ b/std/examples/test.ts
@@ -1,5 +1,8 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
import { assertEquals } from "../testing/asserts.ts";
+import { dirname, relative, resolve, fromFileUrl } from "../path/mod.ts";
+
+const moduleDir = dirname(fromFileUrl(import.meta.url));
/** Example of how to do basic tests */
Deno.test("t1", function (): void {
@@ -17,8 +20,8 @@ Deno.test("catSmoke", async function (): Promise<void> {
Deno.execPath(),
"run",
"--allow-read",
- "examples/cat.ts",
- "README.md",
+ relative(Deno.cwd(), resolve(moduleDir, "cat.ts")),
+ relative(Deno.cwd(), resolve(moduleDir, "..", "README.md")),
],
stdout: "null",
stderr: "null",