-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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): vite-node
to pass correct execution wrapper offset
#7417
fix(coverage): vite-node
to pass correct execution wrapper offset
#7417
Conversation
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
954d2a1
to
0f3f4f5
Compare
@vitest/web-worker
with v8 coveragevite-node
to pass correct execution wrapper offset
e7a39cc
to
4e458b0
Compare
4e458b0
to
008b10d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me 👍
I'm wondering what happens if the same file is imported from test and from @vitest/web-worker
. Does startOffset
conflict (last loaded win?) and so coverage is likely broken?
Yep, coverage could break then. Also V8 gets confused as the same file ID had different contents when executed. The script coverage is a mess then. |
Do we need to update vitest's |
Which package here? vitest/packages/vitest/package.json Lines 124 to 132 in 12eaf3e
Or you mean about using mixed versions? A year ago (#5208) we made the decision that Vitest monorepo's packages do not work with mixed versions. All packages must have the same version. And we've been introducing breaking changes between the packages ever since. There are also runtime warnings in |
e5fa58a
to
89102c3
Compare
8c9f3f8
to
20a348b
Compare
Description
Makes
vite-node
to hold info about the execution wrapper it uses when executing modules. Coverage providers are passed this info on the test runner thread so that they can attach it into the coverage results. There's no longer need to hard-code the wrapper length on main thread codebase. The exampleweb-worker.test.ts
has a case where in a single test runner thread some code is executed with 185 long wrapper and some with ~430 long wrapper.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yaml
unless you introduce a new test example.Tests
pnpm test:ci
.Documentation
pnpm run docs
command.Changesets
feat:
,fix:
,perf:
,docs:
, orchore:
.