| 17 | const tempRoots: string[] = []; |
| 18 | |
| 19 | async function prepareFixture(fixtureName: string): Promise<string> { |
| 20 | const base = await fs.mkdtemp(path.join(tmpdir(), 'openspec-cli-e2e-')); |
| 21 | tempRoots.push(base); |
| 22 | const projectDir = path.join(base, 'project'); |
| 23 | await fs.mkdir(projectDir, { recursive: true }); |
| 24 | const fixtureDir = path.join(cliProjectRoot, 'test', 'fixtures', fixtureName); |
| 25 | await fs.cp(fixtureDir, projectDir, { recursive: true }); |
| 26 | return projectDir; |
| 27 | } |
| 28 | |
| 29 | function expectJsonOnlyOutput(result: Awaited<ReturnType<typeof runCLI>>) { |
| 30 | expect(result.exitCode).toBe(0); |