-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
test: upgrade to vitest v4 #5141
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
base: main
Are you sure you want to change the base?
Conversation
|
Typecheck failures in CI should be fixed by #5138. |
@vueuse/components
@vueuse/core
@vueuse/electron
@vueuse/firebase
@vueuse/integrations
@vueuse/math
@vueuse/metadata
@vueuse/nuxt
@vueuse/router
@vueuse/rxjs
@vueuse/shared
commit: |
|
can you fix lockfile? run |
I think we can merge #5138 first. |
|
this looks better, run |
|
The test errors aren't related to snapshots. They seem to be caused by upstream changes. I'm also looking into solutions. |
|
Looks like we've a regression in jsdom, try pinning jsdom to 20.0.3: vitest-dev/vitest#8017 (comment) |
This issue doesn't seem directly related to our problem — it reports incorrect return values, while we're encountering |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5141 +/- ##
==========================================
- Coverage 67.71% 63.63% -4.09%
==========================================
Files 367 345 -22
Lines 14721 7853 -6868
Branches 2456 2426 -30
==========================================
- Hits 9968 4997 -4971
+ Misses 4742 2312 -2430
- Partials 11 544 +533 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| @@ -1,7 +1,3 @@ | |||
| import process from 'node:process' | |||
|
|
|||
| export const isBelowNode18 = Number(process.version.slice(1).split('.')[0]) < 18 | |||
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.
We don't run CI on Node18 now.
| removeEventListener: vi.fn(), | ||
| dispatchEvent: vi.fn(), | ||
| })) | ||
| const matchMediaSpy = vi.spyOn(window, 'matchMedia') |
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.
Should I mock matchMedia globally or move this file to browser.test.ts?
|
It looks like there's an issue with the test coverage. I'll take a look. |
|
why codecov still with previous old run here #5141 (comment)? |
|
It is still failing, the coverage files are empty. |
| include: [ | ||
| '!packages/**/*.{browser,server}.{test,spec}.ts', | ||
| 'packages/**/*.{test,spec}.ts', | ||
| 'test/*.{test,spec}.ts', | ||
| ], | ||
| exclude: [ | ||
| 'packages/**/*.{browser,server}.{test,spec}.ts', | ||
| ], |
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.
Finally! The coverage failure was caused by this line, which relates to vitest's migration of coverage calculation from test-exclude to picomatch. I haven't looked into it deeply for now, but if I get the chance, I'll open an issue or PR for vitest.
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.
yeah, Vitest should have added a fix => move all include entries that begin with ! to the exclude
This reverts commit cb8ec13.
|
The tests are still failing due to |
cannot pin jsdom to 20.0.3? |
Yes, this didn't resolve the issue and even introduced more errors. See https://github.com/vueuse/vueuse/actions/runs/19108005315/job/54597101035?pr=5141 |
arggg, I'll check it in ~ 1 hour 🤞 |
|
While the tests are passing after bumping jsdom to 27.1.0 now, but I suspect the underlying issue hasn't actually been fixed. 🤔 |
Before submitting the PR, please make sure you do the following
fixes #123).Description
CI is failing in the
useFetchtests. It seems related to vitest and has been fixed invitestv4, see: vitest-dev/vitest#8374Additional context
#5138 (comment)