feat: add istanbul coverage provider#399
Merged
9aoy merged 14 commits intoweb-infra-dev:mainfrom Sep 11, 2025
Merged
Conversation
✅ Deploy Preview for rstest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
9aoy
reviewed
Jul 21, 2025
packages/core/package.json
Outdated
| "istanbul-reports": "^3.1.7", | ||
| "pathe": "^2.0.3", | ||
| "std-env": "^3.9.0", | ||
| "swc-plugin-coverage-instrument": "^0.0.28", |
Collaborator
There was a problem hiding this comment.
Builtin istanbul coverage directly into Rstest is too heavy. Rstest can provide a separate package for users to install as needed. When users set provider: 'istanbul', rstest can import the relevant transform plugin and provider from @rstest/coverage-istanbul.
9aoy
reviewed
Aug 20, 2025
packages/core/src/core/rsbuild.ts
Outdated
| }; | ||
|
|
||
| if (coverage?.enabled && coverage?.provider === 'istanbul') { | ||
| const swcPluginCoverageInstrument = `${process.cwd()}/node_modules/@rstest/coverage-istanbul/node_modules/swc-plugin-coverage-instrument/target/wasm32-wasip1/release/swc_plugin_coverage.wasm`; |
Collaborator
packages/core/src/core/rsbuild.ts
Outdated
| config.module.rules ??= []; | ||
| config.module.rules.push({ | ||
| test: /\.(js|ts)$/, | ||
| exclude: [/node_modules/], |
Collaborator
There was a problem hiding this comment.
some test files should be excluded.
packages/core/src/coverage/index.ts
Outdated
| @@ -0,0 +1,23 @@ | |||
| import type { CoverageOptions } from '../types/coverage'; | |||
| import type { CoverageProvider } from './istanbul'; | |||
| import { IstanbulCoverageProvider } from './istanbul'; | |||
Collaborator
There was a problem hiding this comment.
IstanbulCoverageProvider should also extract to @rstest/coverage-istanbul
This was referenced Sep 15, 2025
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
add istanbul coverage provider.
Related Links
#398
Checklist