-
Notifications
You must be signed in to change notification settings - Fork 0
fix: coverage configs #122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ist of added/excluded files and folders
📝 WalkthroughWalkthroughAdds JS coverage collection to Playwright E2E: fixtures start/stop coverage around pages and attach reports; Playwright reporters always include monocart-reporter with coverage config; monocart-reporter dependency added; vitest coverage excludes expanded; a test mock for api-interceptors was added. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Test as Playwright Test
participant Fixture as E2E Fixture
participant Page as Browser Page
participant Reporter as monocart-reporter
Test->>Fixture: request `page` / `userPage` (provides testInfo)
Fixture->>Page: start JS coverage
Fixture-->>Test: yield Page to test
Test->>Page: execute test actions
Test->>Fixture: test finishes
Fixture->>Page: stop JS coverage, collect data
Fixture->>Reporter: attach coverage via testInfo
Reporter-->>Test: generate coverage outputs (HTML, lcov, etc.)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 6 files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
🤖 Fix all issues with AI agents
In `@frontend/e2e/fixtures.ts`:
- Around line 24-30: Wrap the JS coverage teardown in a try/finally and skip
collection if the page has been closed: for the page fixture (the async page: ({
page }, use, testInfo) => { ... }) and similarly for userPage and adminPage
fixtures, call page.coverage.startJSCoverage before use, then in finally check
page.isClosed() and only call await page.coverage.stopJSCoverage() and
attachCoverageReport(coverage, testInfo) when not closed; ensure any exceptions
from stopJSCoverage are not raised when the page is closed by guarding with that
check.
- Line 2: The import in frontend/e2e/fixtures.ts wrongly pulls
attachCoverageReport from 'monocart-reporter/playwright'; update the module
import to pull attachCoverageReport directly from the package root by changing
the import source to 'monocart-reporter' so the symbol attachCoverageReport is
imported from the main entry that exports it (no other code changes needed).
In `@frontend/playwright.config.ts`:
- Around line 13-27: The sourceFilter function currently checks
sourcePath.includes('/src/') which breaks on Windows backslashes; update the
reporter's sourceFilter (the arrow function assigned to sourceFilter in the
reporter config) to first normalize the incoming sourcePath by converting
Windows backslashes to forward slashes (or use path.posix/replace backslashes)
and then perform precise directory checks using '/src/', '/node_modules/' and
'/__tests__/' (avoid loose substring matches) so filtering works cross-platform
and avoids false positives.
In `@frontend/vitest.config.ts`:
- Around line 19-31: Update the exclude glob in the vitest config's exclude
array so nested route components are skipped; specifically, in
frontend/vitest.config.ts modify the exclude pattern 'src/routes/*.svelte'
within the exclude array to 'src/routes/**/*.svelte' to ensure all routes at any
depth (e.g., src/routes/admin/AdminEvents.svelte) are excluded from coverage.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@frontend/playwright.config.ts`:
- Around line 15-19: The monocart-reporter config writes to
coverage/e2e/report.html and coverage/e2e/lcov.info but the directory may not
exist; fix by ensuring the directory is created before the reporter runs—add a
top-level require/import for fs and call fs.mkdirSync('coverage/e2e', {
recursive: true }) (or equivalent) in the Playwright config file before the
reporter configuration block (the monocart-reporter entry and its outputFile
paths) so the parent directory exists when the reporter writes files.



Summary by cubic
Add E2E code coverage to the frontend using Monocart Playwright Reporter and tighten unit-test coverage filters to avoid double counting. Generates HTML and LCOV reports focused on real app code.
New Features
Dependencies
Written for commit 4c2ac22. Summary will update on new commits.
Summary by CodeRabbit
Tests
Chores
✏️ Tip: You can customize this high-level summary in your review settings.