Skip to content

Commit 9a4d10b

Browse files
committed
Improve test path resolution
1 parent c52fe99 commit 9a4d10b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { join } from "path/mod.ts";
1515
import * as colors from "fmt/colors.ts";
1616
import { runningInCI } from "../src/core/ci-info.ts";
1717
import { relative } from "path/mod.ts";
18+
import { quartoConfig } from "../src/core/quarto.ts";
1819

1920
export interface TestDescriptor {
2021
// The name of the test
@@ -179,7 +180,12 @@ export function test(test: TestDescriptor) {
179180
// Form the test runner command
180181
const originUrl = new URL(context.origin);
181182
const absPath = originUrl.pathname;
182-
const relPath = relative(Deno.cwd(), absPath);
183+
184+
const quartoRoot = join(quartoConfig.binPath(), "..", "..", "..");
185+
const relPath = relative(
186+
join(quartoRoot, "tests"),
187+
absPath,
188+
);
183189
const command = Deno.build.os === "windows"
184190
? "run-tests.psl"
185191
: "./run-test.sh";

0 commit comments

Comments
 (0)