feat: add cache rebuild flag and progress

This commit is contained in:
Sharada Mohanty 2026-04-20 17:55:02 +02:00
parent 1b8e0f8289
commit 2a9daec0ea
5 changed files with 160 additions and 36 deletions

View file

@ -0,0 +1,25 @@
import { describe, expect, it, vi } from 'vitest'
import { createTerminalProgressReporter } from '../src/parse-progress.js'
describe('createTerminalProgressReporter', () => {
it('renders Updating cache progress lines to stderr-compatible streams', () => {
const writes: string[] = []
const stream = {
isTTY: true,
write: vi.fn((chunk: string) => {
writes.push(chunk)
return true
}),
} as unknown as NodeJS.WriteStream
const reporter = createTerminalProgressReporter(true, stream)
reporter?.start('Updating cache', 2)
reporter?.advance('claude/session.jsonl')
reporter?.advance('codex/rollout.jsonl')
reporter?.finish()
expect(writes.join('')).toContain('Updating cache')
expect(writes.join('')).toContain('2/2')
})
})