fix(coverage): add coverageRoot option for monorepo setups#59
Merged
V3RON merged 7 commits intoJan 21, 2026
Conversation
In create-react-native-library projects, tests run from example/ but source files are in ../src/. babel-plugin-istanbul uses cwd as its root and skips files outside it, causing 0% coverage. Added coverageRoot config option to specify the root directory for coverage instrumentation. This is passed to babel-plugin-istanbul's cwd option. Fixes callstackincubator#58
|
@mfazekas is attempting to deploy a commit to the Callstack Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
|
Perhaps this is a documentation-only issue? Instead of adding a new config option, we could just document that users can set NYC_CWD=.. yarn test:harness:ios --coverageThis is a standard babel-plugin-istanbul/nyc environment variable and doesn't require any code changes. Thoughts? |
Contributor
|
I believe this should go into the config file. Users shouldn't need to know exactly how coverage is implemented under the hood. I also wonder whether we have any other configuration properties related to coverage. If so, we might consider nesting root under coverage instead of using a flat coverageRoot 🤔 |
mfazekas
marked this pull request as ready for review
January 20, 2026 13:22
V3RON
approved these changes
Jan 21, 2026
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
Adds
coverage.rootconfig option to fix 0% coverage in create-react-native-library and other monorepo setups.Usage
Fixes #58