Skip to content

Testing and Quality

Current signals

package.json defines parser and tool test scripts. The parser tests exercise model-family stream parsing; tool tests exercise tool-call handling. TypeScript compilation is part of the production build.

pnpm test
pnpm build

What is covered

  • Stream parser behavior for model-specific formats.
  • Tool parsing and execution contracts.
  • Type-level integration across the Vite bundle.

What remains risky

There is no visible broad browser integration suite for microphone permissions, AudioWorklet messages, STT worker model loading, WebGPU inference, TTS playback, memory pressure, or mobile fallback behavior. These areas depend on browser hardware and model assets and should be tested with a small fixture model where possible.

Quality interview answer

“The repository tests the most format-sensitive pure logic—the stream parsers and tools—and uses TypeScript plus the production build as a graph-level gate. The next quality investment would be browser integration tests around the worker/audio lifecycle, because that is where environment-specific failures are concentrated.”

Layer Cases
Pure logic Model-family parsers, tool JSON validation, sentence splitting, WAV conversion
Hook Setup/reset, model switch, abort, pending input, barge-in
Worker VAD events, load progress, final transcript, force submit, worker error
Browser WebGPU unavailable, secure-context warning, microphone denial, cache reload
Audio Sentence queue ordering, stop during synthesis, object URL cleanup
Deployment COOP/COEP headers, worker root paths, static asset caching

Use mocked runtime handles for deterministic tests and one small browser model fixture for an end-to-end smoke path. Full multi-GB model testing should remain a manual compatibility matrix rather than a CI requirement.