Skip to content

[Question] Workspaces support #5

@sirgalleto

Description

@sirgalleto

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

  1. Gets the coverage-final.json file.
  2. Gets the updated files.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions