Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

test(web): support coverage preflight

Gusd5822532fe7b
diff --git a/src/web/scripts/preflight-bug-reports.test.ts b/src/web/scripts/preflight-bug-reports.test.ts
index 8fd28254c..63435bb7a 100644
--- a/src/web/scripts/preflight-bug-reports.test.ts
+++ b/src/web/scripts/preflight-bug-reports.test.ts
@@ -68,8 +68,13 @@ describe("B2d read-only bug-report R2 preflight", () => {
const packageRoot = fileURLToPath(new URL("..", import.meta.url));
const secretMarker = "PREFLIGHT_SECRET_MUST_NOT_LEAK";
const packageManagerCli = process.env.npm_execpath;
- if (!packageManagerCli) throw new Error("npm_execpath is required to invoke the package CLI");
- const child = spawnSync(process.execPath, [packageManagerCli, "run", "preflight:bug-reports"], {
+ const childArgs = packageManagerCli
+ ? [packageManagerCli, "run", "preflight:bug-reports"]
+ : [
+ fileURLToPath(import.meta.resolve("tsx/cli")),
+ fileURLToPath(new URL("./preflight-bug-reports.ts", import.meta.url)),
+ ];
+ const child = spawnSync(process.execPath, childArgs, {
cwd: packageRoot,
encoding: "utf8",
env: {