()
| 278 | } |
| 279 | |
| 280 | export function requireCompiledBinaryPath(): string { |
| 281 | let compiledBinaryPath = resolveCompiledBinaryPath() |
| 282 | if (!compiledBinaryPath) { |
| 283 | const build = Bun.spawnSync({ |
| 284 | cmd: [ |
| 285 | getWrapperHarnessBunBin(), |
| 286 | './build/package.mjs', |
| 287 | '--build-mode', |
| 288 | 'external', |
| 289 | '--skip-archive', |
| 290 | ], |
| 291 | cwd: WRAPPER_HARNESS_REPO_ROOT, |
| 292 | stdout: 'inherit', |
| 293 | stderr: 'inherit', |
| 294 | }) |
| 295 | if (build.exitCode === 0) { |
| 296 | compiledBinaryPath = resolveCompiledBinaryPath() |
| 297 | } |
| 298 | } |
| 299 | if (compiledBinaryPath) { |
| 300 | return compiledBinaryPath |
| 301 | } |
| 302 | |
| 303 | throw new Error( |
| 304 | [ |
| 305 | 'Missing self-contained artifact for wrapper PTY tests.', |
| 306 | 'Build it first with:', |
| 307 | ' bun run build', |
| 308 | ].join('\n'), |
| 309 | ) |
| 310 | } |
| 311 | |
| 312 | export async function spawnStagingWrapperPromptFixture(): Promise<WrapperPtyFixture> { |
| 313 | const compiledBinaryPath = requireCompiledBinaryPath() |
no test coverage detected