-
-
Couldn't load subscription status.
- Fork 11
fix: should exclude test files from coverage collection #559
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
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.
Pull Request Overview
This PR implements test file exclusion from coverage collection by adding configurable exclude patterns to the coverage options. The changes address a previously unimplemented TODO item to exclude test files from coverage collection.
- Added an
excludeoption to the coverage configuration with default patterns for test files - Updated the coverage plugin to use the exclude patterns with the SWC coverage instrument
- Modified test expectations to reflect the new coverage behavior without test files
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/types/coverage.ts | Added exclude option type definition with documentation |
| packages/core/src/config.ts | Added default exclude patterns for test files and directories |
| packages/coverage-istanbul/src/plugin.ts | Updated plugin to accept options and pass exclude patterns to SWC |
| e2e/test-coverage/index.test.ts | Updated test expectations to match new coverage behavior |
| e2e/projects/coverage.test.ts | Updated test expectations for projects coverage |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
packages/core/src/types/coverage.ts
Outdated
| /** | ||
| * A list of glob patterns that should be excluded from coverage collection. | ||
| * | ||
| * @default ['**\/node_modules/**', '**\/dist/**', '**\/test/**', '**\/__tests__/**', '**\/*.{test,spec}.?(c|m)[jt]s?(x)', '**\/__mocks__/**'] |
Copilot
AI
Sep 11, 2025
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.
The JSDoc comment has incorrect escaping of forward slashes. The backslashes before forward slashes should be removed as they are not needed in JSDoc comments.
✅ Deploy Preview for rstest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Summary
should exclude test files from coverage collection.
Related Links
Checklist