Files
AgentCompany/tests/e2e/e2e-global-setup.ts
T
2026-04-04 12:03:50 -04:00

17 lines
532 B
TypeScript

import { execFileSync } from "node:child_process";
import { createElectronLaunchEnv } from "./launch";
/**
* Playwright globalSetup: build the Electron app from source before E2E tests.
* Uses execFileSync and enables shell mode on Windows so the pnpm shim resolves correctly.
*/
export default function globalSetup() {
execFileSync("pnpm", ["electron-vite", "build"], {
stdio: "inherit",
cwd: process.cwd(),
timeout: 120_000,
env: createElectronLaunchEnv({}),
shell: process.platform === "win32",
});
}