Skip to content

Commit 03b7e45

Browse files
chore(repo): Update Vitest to 3.0 (#4929)
Co-authored-by: Jacek <jacek@clerk.dev>
1 parent b993678 commit 03b7e45

File tree

14 files changed

+200
-153
lines changed

14 files changed

+200
-153
lines changed

.changeset/two-icons-begin.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ test-results
8888

8989
# Workflow Outputs
9090
/packages/*/*.tgz
91+
/packages/*/tsconfig.test.vitest-temp.json
9192

9293
# Scripts
9394
scripts/.env

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"@types/node": "^22.10.6",
7272
"@types/react": "catalog:react",
7373
"@types/react-dom": "catalog:react",
74-
"@vitest/coverage-v8": "2.1.4",
74+
"@vitest/coverage-v8": "3.0.2",
7575
"citty": "^0.1.4",
7676
"conventional-changelog-conventionalcommits": "^4.6.3",
7777
"cpy-cli": "^5.0.0",
@@ -105,11 +105,11 @@
105105
"turbo-ignore": "^2.0.6",
106106
"typescript": "catalog:repo",
107107
"verdaccio": "^5.26.3",
108-
"vitest": "2.1.4",
108+
"vitest": "3.0.2",
109109
"yalc": "1.0.0-pre.53",
110110
"zx": "catalog:repo"
111111
},
112-
"packageManager": "pnpm@9.13.0+sha512.beb9e2a803db336c10c9af682b58ad7181ca0fbd0d4119f2b33d5f2582e96d6c0d93c85b23869295b765170fbdaa92890c0da6ada457415039769edf3c959efe",
112+
"packageManager": "pnpm@9.15.4+sha512.b2dc20e2fc72b3e18848459b37359a32064663e5627a51e4c74b2c29dd8e8e0491483c3abb40789cfd578bf362fb6ba8261b05f0387d76792ed6e23ea3b1b6a0",
113113
"engines": {
114114
"node": ">=18.17.0",
115115
"pnpm": ">=9"

packages/backend/package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,13 @@
8787
"lint:publint": "publint",
8888
"lint:attw": "attw --pack . --ignore-rules false-cjs",
8989
"test": "run-s test:node test:edge-runtime test:cloudflare-miniflare",
90-
"test:node": "vitest --environment node",
91-
"test:edge-runtime": "vitest --environment edge-runtime",
92-
"test:cloudflare-miniflare": "vitest --environment miniflare"
90+
"test:node": "vitest run --environment node",
91+
"test:edge-runtime": "vitest run --environment edge-runtime",
92+
"test:cloudflare-miniflare": "vitest run --environment miniflare",
93+
"test:watch": "run-s test:watch:node test:watch:edge-runtime test:watch:cloudflare-miniflare",
94+
"test:watch:node": "vitest watch --environment node",
95+
"test:watch:edge-runtime": "vitest watch --environment edge-runtime",
96+
"test:watch:cloudflare-miniflare": "vitest watch --environment miniflare"
9397
},
9498
"dependencies": {
9599
"@clerk/shared": "workspace:^",

packages/backend/vitest.config.mts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ export default defineConfig({
66
coverage: {
77
provider: 'v8',
88
},
9+
fakeTimers: {
10+
toFake: ['setTimeout', 'clearTimeout', 'Date'],
11+
},
912
includeSource: ['**/*.{js,ts,jsx,tsx}'],
1013
setupFiles: './vitest.setup.mts',
1114
},

packages/expo/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@
6363
"dev:publish": "pnpm dev -- --env.publish",
6464
"lint": "eslint src/",
6565
"publish:local": "pnpm yalc push --replace --sig",
66-
"test": "vitest"
66+
"test": "vitest run",
67+
"test:watch": "vitest watch"
6768
},
6869
"dependencies": {
6970
"@clerk/clerk-js": "workspace:^",

packages/nextjs/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@
6262
"lint:attw": "attw --pack . --ignore-rules no-resolution unexpected-module-syntax",
6363
"lint:publint": "publint",
6464
"publish:local": "pnpm yalc push --replace --sig",
65-
"test": "vitest"
65+
"test": "vitest run",
66+
"test:watch": "vitest watch"
6667
},
6768
"dependencies": {
6869
"@clerk/backend": "workspace:^",

packages/nuxt/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
"lint:attw": "attw --pack . --ignore-rules no-resolution cjs-resolves-to-esm",
5656
"lint:publint": "publint",
5757
"publish:local": "pnpm yalc push --replace --sig",
58-
"test": "vitest"
58+
"test": "vitest run",
59+
"test:watch": "vitest watch"
5960
},
6061
"dependencies": {
6162
"@clerk/backend": "workspace:^",

packages/react-router/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@
6969
"lint:attw": "attw --pack . --ignore-rules cjs-resolves-to-esm",
7070
"lint:publint": "publint",
7171
"publish:local": "pnpm dlx yalc push --replace --sig",
72-
"test": "vitest"
72+
"test": "vitest run",
73+
"test:watch": "vitest watch"
7374
},
7475
"dependencies": {
7576
"@clerk/backend": "workspace:^",

packages/react/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@
7171
"lint:attw": "attw --pack .",
7272
"lint:publint": "publint",
7373
"publish:local": "pnpm yalc push --replace --sig",
74-
"test": "vitest"
74+
"test": "vitest run",
75+
"test:watch": "vitest watch"
7576
},
7677
"dependencies": {
7778
"@clerk/shared": "workspace:^",

0 commit comments

Comments
 (0)