Skip to content

Commit 0a301ee

Browse files
committed
test(e2e): run proxy probe with tsx
1 parent 66402d9 commit 0a301ee

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/cli/tests/e2e/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function monorepoRoot(): string {
2828
return join(cliPackageRoot, "..", "..");
2929
}
3030

31-
function localBin(name: string): string {
31+
export function localBin(name: string): string {
3232
return join(
3333
monorepoRoot(),
3434
"node_modules",

packages/cli/tests/e2e/proxy.e2e.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { tmpdir } from "os";
66
import { join } from "path";
77
import { promisify } from "util";
88
import { afterAll, beforeAll, describe, expect, test } from "vite-plus/test";
9-
import { cliPackageRoot } from "./helpers.ts";
9+
import { cliPackageRoot, localBin } from "./helpers.ts";
1010

1111
const execFileAsync = promisify(execFile);
1212

@@ -54,7 +54,7 @@ beforeAll(async () => {
5454
proxyUrl = `http://127.0.0.1:${(proxy.address() as AddressInfo).port}`;
5555

5656
scriptDir = mkdtempSync(join(tmpdir(), "bl-proxy-e2e-"));
57-
scriptPath = join(scriptDir, "probe.ts");
57+
scriptPath = join(scriptDir, "probe.mts");
5858
writeFileSync(scriptPath, PROBE_SCRIPT);
5959
});
6060

@@ -75,7 +75,7 @@ async function runProbe(
7575
envOverrides: NodeJS.ProcessEnv,
7676
): Promise<{ exitCode: number; stderr: string }> {
7777
try {
78-
await execFileAsync("node", [scriptPath], {
78+
await execFileAsync(localBin("tsx"), [scriptPath], {
7979
cwd: cliPackageRoot,
8080
encoding: "utf8",
8181
env: { ...process.env, NODE_NO_WARNINGS: "1", ...PROXY_ENV_CLEARED, ...envOverrides },

0 commit comments

Comments
 (0)