()
| 15 | import * as path from "path"; |
| 16 | |
| 17 | export async function createTestHistoryService(): Promise<{ |
| 18 | historyService: HistoryService; |
| 19 | config: Config; |
| 20 | tempDir: string; |
| 21 | cleanup: () => Promise<void>; |
| 22 | }> { |
| 23 | const tempDir = path.join( |
| 24 | os.tmpdir(), |
| 25 | `mux-test-history-${Date.now()}-${Math.random().toString(36).slice(2)}` |
| 26 | ); |
| 27 | await fs.mkdir(tempDir, { recursive: true }); |
| 28 | const config = new Config(tempDir); |
| 29 | const historyService = new HistoryService(config); |
| 30 | return { |
| 31 | historyService, |
| 32 | config, |
| 33 | tempDir, |
| 34 | cleanup: () => fs.rm(tempDir, { recursive: true, force: true }), |
| 35 | }; |
| 36 | } |
no outgoing calls