From e7a323adefeeea0e5b7478a7bf51c31bc290c759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=96=E4=BB=AC=E9=83=BD=E4=B8=8D=E7=8E=A9=E4=BA=86?= Date: Tue, 10 Nov 2026 23:54:38 +0000 Subject: [PATCH] test(inspector): decode file URLs in HTTP contract fixtures (#6010) --- packages/inspector/tests/httpContract.test.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/inspector/tests/httpContract.test.ts b/packages/inspector/tests/httpContract.test.ts index a849534d70..25fc912519 100644 --- a/packages/inspector/tests/httpContract.test.ts +++ b/packages/inspector/tests/httpContract.test.ts @@ -4,6 +4,7 @@ import { mkdtempSync, symlinkSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; import { createInterface } from "node:readline"; +import { fileURLToPath } from "node:url"; import { expect, it } from "vitest"; import { createInspectorServer } from "../src/server"; @@ -11,7 +12,7 @@ const project = mkdtempSync(join(tmpdir(), "hf-inspector-")); function start(env?: NodeJS.ProcessEnv) { const server = spawn("bun", ["src/server.ts", project, "0"], { - cwd: new URL("..", import.meta.url).pathname, + cwd: fileURLToPath(new URL("..", import.meta.url)), stdio: ["ignore", "pipe", "pipe"], env, }); @@ -122,9 +123,9 @@ it("importing the server does not listen", () => { it("starts when the entry path is a symlink", async () => { const dir = mkdtempSync(join(tmpdir(), "hf-bin-")); const link = join(dir, "hyperframes-inspector"); - symlinkSync(new URL("../src/server.ts", import.meta.url).pathname, link); + symlinkSync(fileURLToPath(new URL("../src/server.ts", import.meta.url)), link); const child = spawn("bun", [link, project, "0"], { - cwd: new URL("..", import.meta.url).pathname, + cwd: fileURLToPath(new URL("..", import.meta.url)), stdio: ["ignore", "pipe", "pipe"], }); const lines = createInterface({ input: child.stdout! });