The StreamingQueue class (web/src/utils/streaming-queue.ts, 92 lines) has no tests.
It's a self-contained class with add(), flushNow(), and destroy() methods that batches streaming text updates using requestAnimationFrame.
What to do:
- Read
web/src/utils/streaming-queue.ts to understand the API
- Create
web/src/utils/__tests__/streaming-queue.test.ts
- Test cases to cover:
add() queues items and flushNow() delivers them
destroy() stops further processing
- Empty queue behavior
- Multiple adds before flush
- Mock
requestAnimationFrame in tests (or just test via flushNow())
- Run:
pnpm -C web run test -- --run streaming-queue
Skills needed: TypeScript, Vitest
Estimated time: 1 hour
The
StreamingQueueclass (web/src/utils/streaming-queue.ts, 92 lines) has no tests.It's a self-contained class with
add(),flushNow(), anddestroy()methods that batches streaming text updates usingrequestAnimationFrame.What to do:
web/src/utils/streaming-queue.tsto understand the APIweb/src/utils/__tests__/streaming-queue.test.tsadd()queues items andflushNow()delivers themdestroy()stops further processingrequestAnimationFramein tests (or just test viaflushNow())pnpm -C web run test -- --run streaming-queueSkills needed: TypeScript, Vitest
Estimated time: 1 hour