chore(repo): Migrate to Vitest 5 - #9664
Conversation
🦋 Changeset detectedLatest commit: a86baa3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-google-signin
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
| declare module 'vitest' { | ||
| // eslint-disable-next-line @typescript-eslint/no-empty-object-type | ||
| interface Assertion<T = any> extends CustomMatchers<T> {} | ||
| interface Assertion<R, T> extends CustomMatchers<R> {} |
There was a problem hiding this comment.
new two-parameter Assertion interface for custom matcher augmentations https://vitest.dev/guide/migration/#assertion-types-expose-return-and-received-types
| vi.stubGlobal('window', mockWindow); | ||
| vi.stubGlobal('getComputedStyle', mockGetComputedStyle); | ||
| vi.stubGlobal('document', { |
There was a problem hiding this comment.
global assignments in DOM environments now propagate to the window https://vitest.dev/guide/migration/#dom-environment-global-assignments-now-update-the-underlying-window
this is the documented way to override globals
| @@ -1,3 +0,0 @@ | |||
| import { defineWorkspace } from 'vitest/config'; | |||
|
|
|||
| export default defineWorkspace(['./packages/*/vitest.config.{mts,mjs,js,ts}', './scripts/vitest.config.mjs']); | |||
There was a problem hiding this comment.
🪓 defineWorkspace no longer exists in Vitest 5 and nothingr eferenced this file, turbo runs vitest per package
If we ever need a root runner, the equivalent is test.projects
Description
Migrates the monorepo to Vitest 5 https://vitest.dev/blog/vitest-5.html
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change