| 1 | // The OpenNext build copies the NFT-traced node_modules into |
| 2 | // `.open-next/server-functions/default/node_modules`. Under bun's isolated |
| 3 | // linker that tree is built from `.bun` store junctions, and the copy leaves |
| 4 | // them broken on Windows — esbuild's final bundle pass then fails with |
| 5 | // `Cannot read directory ".open-next/.../node_modules/.bun/.../react": Access |
| 6 | // is denied`. Skip the e2e on Windows until the copy re-materializes |
| 7 | // junctioned directories (upstream OpenNext has the same constraint). |
| 8 | import { execSync } from "node:child_process"; |
| 9 | |
| 10 | if (process.platform === "win32") { |
| 11 | console.log( |
| 12 | "packages/frontend-frameworks/fixtures/nextjs e2e skipped on Windows: OpenNext build cannot traverse bun-store junctions (see scripts/e2e.mjs).", |
| 13 | ); |
| 14 | process.exit(0); |
| 15 | } |
| 16 | |
| 17 | // `bun run` puts the fixture's node_modules/.bin on PATH, so playwright |
| 18 | // resolves from the fixture (a bare `bun x playwright` can load the parent |
| 19 | // workspace's copy and die with "Requiring @playwright/test second time"). |
| 20 | execSync("bun run test:e2e", { stdio: "inherit" }); |