(data: unknown)
| 19 | }) |
| 20 | |
| 21 | function writeTempJson(data: unknown): string { |
| 22 | const file = path.join(os.tmpdir(), `chatlab-pull-engine-test-${process.pid}-${tempFiles.length}.json`) |
| 23 | fs.writeFileSync(file, JSON.stringify(data), 'utf-8') |
| 24 | tempFiles.push(file) |
| 25 | return file |
| 26 | } |
| 27 | |
| 28 | async function withImmediateTimers<T>(fn: () => Promise<T>): Promise<T> { |
| 29 | const originalSetTimeout = globalThis.setTimeout |