(options: Record<string, unknown> = {})
| 10 | | { id: string; seq: number; name: "exit"; value: number }; |
| 11 | |
| 12 | function fixture(options: Record<string, unknown> = {}): { |
| 13 | runner: InstanceType<typeof Runner>; |
| 14 | db: Database; |
| 15 | fs: WorkspaceFilesystem; |
| 16 | dispose: () => void; |
| 17 | } { |
| 18 | const storage = new SQLiteTestStorage(); |
| 19 | const db = new Database(storage); |
| 20 | initializeSchema(db, () => Date.now()); |
| 21 | const fs = new WorkspaceFilesystem(db, { now: () => Date.now() }); |
| 22 | const runner = new Runner({ db, ...options }); |
| 23 | return { |
| 24 | runner, |
| 25 | db, |
| 26 | fs, |
| 27 | dispose: () => { |
| 28 | runner.disposeAll(); |
| 29 | storage.close?.(); |
| 30 | }, |
| 31 | }; |
| 32 | } |
| 33 | |
| 34 | async function drain(stream: ReadableStream<ExecEvent>): Promise<ExecEvent[]> { |
| 35 | const events: ExecEvent[] = []; |
no test coverage detected