()
| 44 | } |
| 45 | |
| 46 | function startServer() { |
| 47 | const serverScript = path.join(projectRoot, 'scripts/local-artifacts-server.js'); |
| 48 | fs.mkdirSync(artifactsRoot, { recursive: true }); |
| 49 | |
| 50 | const child = spawn('node', [serverScript], { |
| 51 | cwd: projectRoot, |
| 52 | detached: true, |
| 53 | stdio: 'ignore', |
| 54 | env: { |
| 55 | ...process.env, |
| 56 | E2E_ASSET_PORT: String(LOCAL_UPDATE_PORT), |
| 57 | }, |
| 58 | }); |
| 59 | child.unref(); |
| 60 | fs.writeFileSync(pidFile, String(child.pid)); |
| 61 | } |
| 62 | |
| 63 | function waitForServer(timeoutMs = 30000) { |
| 64 | const start = Date.now(); |