Skip to content

armgit / rea

Public Imported from GitHub
0

Reverse engineer anything with agents, from app behavior down to native binaries.

test(applications): import capture fixtures with file URLs (#3050)

Guilherme Dias Fusari89faa863ed47
diff --git a/tests/acceptance/applications/applicationWorkflowCli.test.ts b/tests/acceptance/applications/applicationWorkflowCli.test.ts
index 6f352796e..ad9f960ae 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",