mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-05-05 10:41:37 +00:00
feat: add cache rebuild flag and progress
This commit is contained in:
parent
1b8e0f8289
commit
2a9daec0ea
5 changed files with 160 additions and 36 deletions
25
tests/parse-progress.test.ts
Normal file
25
tests/parse-progress.test.ts
Normal 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')
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue