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

fix(coverage): istanbul-reports to support projectRoot #2051

Merged
merged 1 commit into from Sep 18, 2022

Conversation

AriPerkkio
Copy link
Member

Adds support for configuring projectRoot of istanbul-reports. This is something that nyc does as well: https://github.com/istanbuljs/nyc/blob/v15.1.0/index.js#L465. c8 has similar PR open.

The istanbul-reports uses this internally for reporters ['clover', 'cobertura', 'lcovonly']. Many third party tooling use the pure lcov.info when creating their own reports, e.g. SonarQube.

Example

/workspaces/__vitest-monorepo-coverage
├── package.json
└── packages
   ├── a
   |  ├── package.json
   |  └── src
   |     └── index.js
   └── b
      ├── package.json
      ├── src
      |  ├── add-and-double.js
      |  └── add-and-double.test.js
      └── vitest.config.js
// packages/b/vitest.config.js
export default defineConfig({
  test: { coverage: { provider: "istanbul", reporter: 'lcovonly' } }
});
# Run in project root
$ vitest run --coverage -r packages/b

coverage/lcov.info:
Before: SF:packages/b/src/add-and-double.js
After: SF:src/add-and-double.js

@antfu antfu merged commit 62c1001 into vitest-dev:main Sep 18, 2022
@AriPerkkio AriPerkkio deleted the fix/istanbul-projectroot branch September 18, 2022 06:42
renovate bot added a commit to BeeeQueue/arm-server that referenced this pull request Sep 18, 2022
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@vitest/coverage-c8](https://togithub.com/vitest-dev/vitest) |
[`0.23.2` ->
`0.23.4`](https://renovatebot.com/diffs/npm/@vitest%2fcoverage-c8/0.23.2/0.23.4)
|
[![age](https://badges.renovateapi.com/packages/npm/@vitest%2fcoverage-c8/0.23.4/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/npm/@vitest%2fcoverage-c8/0.23.4/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/npm/@vitest%2fcoverage-c8/0.23.4/compatibility-slim/0.23.2)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/npm/@vitest%2fcoverage-c8/0.23.4/confidence-slim/0.23.2)](https://docs.renovatebot.com/merge-confidence/)
|
| [vitest](https://togithub.com/vitest-dev/vitest) | [`0.23.2` ->
`0.23.4`](https://renovatebot.com/diffs/npm/vitest/0.23.2/0.23.4) |
[![age](https://badges.renovateapi.com/packages/npm/vitest/0.23.4/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/npm/vitest/0.23.4/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/npm/vitest/0.23.4/compatibility-slim/0.23.2)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/npm/vitest/0.23.4/confidence-slim/0.23.2)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>vitest-dev/vitest</summary>

###
[`v0.23.4`](https://togithub.com/vitest-dev/vitest/releases/tag/v0.23.4)

[Compare
Source](https://togithub.com/vitest-dev/vitest/compare/v0.23.2...v0.23.4)

#####    🚀 Features

- Give helpful message, when using vi.mock  -  by
[@&#8203;sheremet-va](https://togithub.com/sheremet-va) in
[vitest-dev/vitest#2047
- **benchmark**: Only mode  -  by
[@&#8203;Aslemammad](https://togithub.com/Aslemammad) in
[vitest-dev/vitest#2039

#####    🐞 Bug Fixes

- Move outputFile to benchmark, allow --reporter for benchmark  -  by
[@&#8203;sheremet-va](https://togithub.com/sheremet-va) in
[vitest-dev/vitest#2037
- **cli**: Forward node wasm flags  -  by
[@&#8203;Peeterush](https://togithub.com/Peeterush) in
[vitest-dev/vitest#2041
- **coverage**: `istanbul-reports` to support `projectRoot`  -  by
[@&#8203;AriPerkkio](https://togithub.com/AriPerkkio) in
[vitest-dev/vitest#2051

#####     [View changes on
GitHub](https://togithub.com/vitest-dev/vitest/compare/v0.23.3...v0.23.4)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 11am" (UTC), Automerge - At
any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click
this checkbox.

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/BeeeQueue/arm-server).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xOTcuMCIsInVwZGF0ZWRJblZlciI6IjMyLjE5Ny4wIn0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants