Skip to content
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

allowExternal option for v8 coverage provider #3867

Closed
4 tasks done
vojvodics opened this issue Aug 2, 2023 · 2 comments · Fixed by #3894
Closed
4 tasks done

allowExternal option for v8 coverage provider #3867

vojvodics opened this issue Aug 2, 2023 · 2 comments · Fixed by #3894
Labels
enhancement New feature or request feat: coverage Issues and PRs related to the coverage feature

Comments

@vojvodics
Copy link
Contributor

vojvodics commented Aug 2, 2023

Clear and concise description of the problem

Since the @vitest/coverage-c8 is removed in favor of @vitest/coverage-v8 (#3339) and coverage-v8 doesn't provide the allowExternal option this will break coverage reports when upgrading to the latest vitest version (and switching providers).

Suggested solution

Implement the allowExternal option (as suggested in the above-mentioned PR). I'd be happy to provide the implementation (LMK if you have any inputs/suggestions on how to do this)

Alternative

No response

Additional context

No response

Validations

@AriPerkkio AriPerkkio added enhancement New feature or request feat: coverage Issues and PRs related to the coverage feature labels Aug 2, 2023
@AriPerkkio
Copy link
Member

This should also be implemented to @vitest/coverage-istanbul. They both use the same test-exclude dependency which I think provides this in c8: https://github.com/bcoe/c8/blob/a13584d5be5259ebb6a00455d352c3e8b16006de/lib/report.js#L48-L52.

I'd be happy to provide the implementation

PR is welcome! Here is one PR for reference to show which files, tests and documentation needs changes when adding new coverage options: #3453.
Let me know if you need any help.

@vojvodics
Copy link
Contributor Author

@AriPerkkio I drafted a PR for this, can you check it out? #3894

I actually would need help with writing good tests for this feature. I added some tests but I don't think they do what they should do. Please check out the comments in the PR 🙏

@github-actions github-actions bot locked and limited conversation to collaborators Sep 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request feat: coverage Issues and PRs related to the coverage feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants