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): browser mode + coverage.all #7597

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

AriPerkkio
Copy link
Member

@AriPerkkio AriPerkkio commented Mar 2, 2025

Description

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

Copy link

pkg-pr-new bot commented Mar 2, 2025

@vitest/browser

npm i https://pkg.pr.new/@vitest/browser@7597

@vitest/coverage-istanbul

npm i https://pkg.pr.new/@vitest/coverage-istanbul@7597

@vitest/expect

npm i https://pkg.pr.new/@vitest/expect@7597

@vitest/mocker

npm i https://pkg.pr.new/@vitest/mocker@7597

@vitest/coverage-v8

npm i https://pkg.pr.new/@vitest/coverage-v8@7597

@vitest/pretty-format

npm i https://pkg.pr.new/@vitest/pretty-format@7597

@vitest/runner

npm i https://pkg.pr.new/@vitest/runner@7597

@vitest/snapshot

npm i https://pkg.pr.new/@vitest/snapshot@7597

@vitest/spy

npm i https://pkg.pr.new/@vitest/spy@7597

@vitest/ui

npm i https://pkg.pr.new/@vitest/ui@7597

@vitest/utils

npm i https://pkg.pr.new/@vitest/utils@7597

vite-node

npm i https://pkg.pr.new/vite-node@7597

vitest

npm i https://pkg.pr.new/vitest@7597

@vitest/web-worker

npm i https://pkg.pr.new/@vitest/web-worker@7597

@vitest/ws-client

npm i https://pkg.pr.new/@vitest/ws-client@7597

commit: 12d473c

Copy link

netlify bot commented Mar 2, 2025

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 04bd008
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/67cc0da4b3a03e00080efc28
😎 Deploy Preview https://deploy-preview-7597--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@AriPerkkio AriPerkkio force-pushed the fix/browser-mode-coverage-all branch from 85550bc to 874d14d Compare March 4, 2025 08:25
@AriPerkkio AriPerkkio force-pushed the fix/browser-mode-coverage-all branch from a2a5043 to 272ae0d Compare March 4, 2025 14:36
@AriPerkkio AriPerkkio force-pushed the fix/browser-mode-coverage-all branch 5 times, most recently from bae901e to 73c530e Compare March 6, 2025 18:28
@AriPerkkio AriPerkkio force-pushed the fix/browser-mode-coverage-all branch 7 times, most recently from b4fa6d4 to 2208f7d Compare March 8, 2025 11:52
@AriPerkkio AriPerkkio force-pushed the fix/browser-mode-coverage-all branch from 2208f7d to 12d473c Compare March 8, 2025 13:55
Copy link
Member Author

@AriPerkkio AriPerkkio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright the Windows issues are finally resolved. @mrginglymus could you do one final check with https://pkg.pr.new/vitest@12d473c and equivalent preview packages with your real-world project?

Comment on lines +551 to +552
// On Windows root doesn't start with "/" while filenames do
if (!filename.startsWith(root) && !filename.startsWith(`/${root}`)) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Windows the root is here D:/a/vitest/vitest/test/coverage-test while filename is /D:/a/vitest/vitest/test/coverage-test/fixtures/src/untested-file.ts.

continue
}

if (browser) {
browser.config.optimizeDeps.noDiscovery = true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sheremet-va do you think we need to reset this back to its original value after coverage is generated? Now that it's left as true, would this cause issues in watch-mode?

@AriPerkkio AriPerkkio marked this pull request as ready for review March 8, 2025 14:21
@AriPerkkio
Copy link
Member Author

AriPerkkio commented Mar 8, 2025

/ecosystem-ci run

E: Looks like recent pnpm catalog changes broke whole ecosystem-ci. Unrelated to this PR.

@vitest-ecosystem-ci

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Import conditions not respected on main thread
1 participant