Hi, I'm opening this PR because I see an opportunity to add support to workspaces/monorepos/multi-package repositories. You can find the npm RFC of the feature here
When you're working with workspaces, is common that each workspace has its own test suit, and maybe a custom configuration.
As far as I understand, the current plugin configuration
- Gets the coverage-final.json file.
- Gets the updated files.
- Matches each file path with the info in the coverage-final.json
But in the case of a workspace, having multiple tests configuration and coverage-final.json or even packages with no tests, you end up with a non-reliable coverage report.
I think we can tweak this for workspaces adding multiple code coverage configurations with a package path to isolate the code-coverage analysis under that path
for example:
codeCoverage([
{
package: 'packages/package-a'
ignoreCoveragePattern: ['.json', '.yml'],
coverageFilesPath: 'packages/package-a/coverage/coverage-final.json'
},
{
package: 'packages/package-b'
ignoreCoveragePattern: ['.json', '.yml'],
coverageFilesPath: 'packages/package-b/coverage/coverage-final.json'
}
])
What do you think? I'm willing to take an action and code this implementation.
Hi, I'm opening this PR because I see an opportunity to add support to workspaces/monorepos/multi-package repositories. You can find the npm RFC of the feature here
When you're working with workspaces, is common that each workspace has its own test suit, and maybe a custom configuration.
As far as I understand, the current plugin configuration
But in the case of a workspace, having multiple tests configuration and
coverage-final.jsonor even packages with no tests, you end up with a non-reliable coverage report.I think we can tweak this for workspaces adding multiple code coverage configurations with a package path to isolate the code-coverage analysis under that path
for example:
What do you think? I'm willing to take an action and code this implementation.