Add test coverage for analysis pipeline (FLO-160)#4
Conversation
New test files covering the previously untested critical paths: - runPool: concurrency limiting, abort signal, progress callbacks, empty input - buildModel: each provider case, -1m long-context suffix handling - extractSignals: happy path, empty response, throw, prompt/signal forwarding - generateSummary: empty fragments guard, happy path, empty response, throw, prompt contents - Analyze route: render, no-session redirect guard, side buttons, extraction flow, error/retry states, missing-key warning 82 tests total (46 existing + 36 new), all passing. Co-Authored-By: Paperclip <noreply@paperclip.ing>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThis PR adds five Vitest test suites covering core library utilities and a route component: ChangesTest Suite Addition for Core Library and Route Components
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- buildModel.test.ts: cast through unknown (LanguageModel union does not overlap MockModel) so tsc -b passes; pnpm build/deploy was failing - runPool.test.ts: drop unused beforeEach import - extractSignals.test.ts: biome formatting Co-Authored-By: Paperclip <noreply@paperclip.ing>
Summary
runPool.test.ts: concurrency limiting, abort signal, onProgress callbacks, empty-input guard, concurrency-cap edge case (6 tests)buildModel.test.ts: OpenAI, Anthropic, OpenRouter provider cases;-1mlong-context suffix strips model id and addsanthropic-betaheader (5 tests)extractSignals.test.ts: happy path, empty-text response, throw path, non-Error throw, prompt/abort-signal forwarding,finishReason=lengtherror description (7 tests)generateSummary.test.ts: empty-fragments guard, happy path, empty-text response, throw path, prompt contents, abort-signal forwarding, fragment-count in prompt (7 tests)Analyze.test.tsx: render/redirect guards (no session, no provider), chunk list, side buttons, disabled Run summary, extraction flow, done/error/retry states, missing-key warning, back-link (11 tests)Test plan
pnpm test --run— 82 tests pass (46 existing + 36 new), no regressions-1msuffix, extractSignals/generateSummary mocked happy+error paths, Analyze render + interaction🤖 Generated with Claude Code
Summary by CodeRabbit