From 89faa863ed472d8a13a826014331d3b81cfc5de3 Mon Sep 17 00:00:00 2001 From: Guilherme Dias Fusari <103198882+GuilhermeFusari@users.noreply.github.com> Date: Thu, 15 Oct 2026 13:18:04 -0300 Subject: [PATCH] test(applications): import capture fixtures with file URLs (#3050) Convert the selected filesystem path at the fixture execution boundary. Exercise spaces and hash characters without changing real execution, CLI/MCP comparisons or the test timeout. Verified the full Linux and native Windows files with real ESM-loader negative controls. Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com> --- .../applications/applicationWorkflowCli.test.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/acceptance/applications/applicationWorkflowCli.test.ts b/tests/acceptance/applications/applicationWorkflowCli.test.ts index 6f352796e2..ad9f960ae7 100644 --- a/tests/acceptance/applications/applicationWorkflowCli.test.ts +++ b/tests/acceptance/applications/applicationWorkflowCli.test.ts @@ -3,6 +3,7 @@ import { createHash } from "node:crypto"; import { copyFile, mkdir, writeFile } from "node:fs/promises"; import { createRequire } from "node:module"; import { join, relative, resolve } from "node:path"; +import { pathToFileURL } from "node:url"; import { promisify } from "node:util"; import { Client } from "@modelcontextprotocol/client"; @@ -1183,7 +1184,9 @@ describe("application workflow CLI copy boundaries", () => { describe("application workflow CLI and MCP capture lifetimes", () => { it("compares captured primitives and source values after aliases are replaced", async () => { - const root = await createTestTempDirectory("rea-capture-lifetime-cli-"); + const parent = await createTestTempDirectory("rea-capture-lifetime-cli-"); + const root = join(parent, "fixtures # capture"); + await mkdir(root); const fields = [ "rebound", "rest", @@ -1247,7 +1250,9 @@ describe("application workflow CLI and MCP capture lifetimes", () => { "--input-type=module", "--eval", "const module = await import(process.argv[1]); console.log(JSON.stringify(module.default()));", - join(root, String(index), "parser.mjs"), + // ESM import() takes a URL specifier; a Windows drive path parses as a + // `c:` URL scheme and is rejected. + pathToFileURL(join(root, String(index), "parser.mjs")).href, ]); expect(JSON.parse(stdout)).toEqual({ kind: "capture-boundary",