test: restore branch coverage threshold to 85%#118
Conversation
|
Claude finished @BillChirico's task in 1m 58s —— View job Review: PR #118 — Restore branch coverage threshold to 85%
Found 2 issues (1 warning, 1 nitpick):
AI fix prompt (copy-paste into Claude Code) |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR introduces two new test suites to increase branch coverage from 83% to 85%, and updates the coverage threshold accordingly. Tests cover event handlers (message creation, reactions, reviews, challenges), reply detection, error handling, and Sentry initialization behavior across various environment configurations. Changes
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
| Filename | Overview |
|---|---|
| vitest.config.js | Restored branch coverage threshold from 83% to 85% as intended |
| tests/modules/events.coverage.test.js | New coverage tests for events module - comprehensive branch coverage with minor formatting cleanup |
| tests/sentry.init.test.js | New coverage tests for Sentry initialization - covers all configuration branches |
| web/src/hooks/use-moderation-cases.ts | Fixed exhaustive-deps warnings but introduced dead code in client-side sort toggle |
Last reviewed commit: b80a017
There was a problem hiding this comment.
Pull request overview
Restores the project’s Vitest branch coverage gate back to 85% by adding targeted tests that exercise previously uncovered branches in low-coverage modules.
Changes:
- Raised Vitest branch coverage threshold from 83% to 85%.
- Added Sentry init tests to cover DSN/env/trace-rate and
beforeSendfiltering/scrubbing branches. - Added events-module coverage tests to hit a variety of early-return and error-handling branches.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
vitest.config.js |
Restores branch coverage threshold to 85%. |
tests/sentry.init.test.js |
Adds targeted tests for src/sentry.js initialization and beforeSend branch behavior. |
tests/modules/events.coverage.test.js |
Adds a coverage-focused suite to exercise multiple branches in src/modules/events.js. |
package-lock.json |
Updates lockfile contents (deps/engine metadata) alongside the test/coverage changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Caution Docstrings generation - FAILED No docstrings were generated. |
b80a017
There was a problem hiding this comment.
Two issues found:
-
🟡 Missing
pollHandler.jsmock (tests/modules/events.coverage.test.js:82) — The existingevents.test.jsmockspollHandler.js, but this new test file doesn't. Sinceevents.jsstatically imports it, the real module (and its dependencies) get pulled in, coupling the test to unrelated production code. -
🔵 Dead useEffect (
web/src/hooks/use-moderation-cases.ts:96-101) — After changing the dep array from[sortDesc]to[], this effect is a no-op (runs once on mount whencasesDatais null). Should be removed entirely since the fetch effect now handles sort direction.
Summary
Restores branch coverage threshold from 83% (temporary) back to 85% by adding targeted tests for low-branch modules.
Changes
vitest.config.js— branch threshold back to 85%tests/modules/events.coverage.test.js— new coverage tests for events module branchestests/sentry.init.test.js— new coverage tests for Sentry init branchesCoverage
Closes #117