Skip to content

Commit bc60e62

Browse files
Jak-Ch-llNorbiros
authored andcommitted
chore: fix vitest types test setup
1 parent 0f8029b commit bc60e62

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ pnpm lint
8989
# Run Vitest
9090
pnpm test
9191
pnpm test:watch
92+
pnpm test --project nuxt
93+
pnpm test --project types
9294

9395
# Release new version
9496
pnpm release
File renamed without changes.

playground/vitest.config.ts

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
1-
import { defineVitestConfig } from '@nuxt/test-utils/config'
1+
import { defineVitestProject } from '@nuxt/test-utils/config'
2+
import { defineConfig } from 'vitest/config'
23

3-
export default defineVitestConfig({
4+
// https://nuxt.com/docs/4.x/getting-started/testing#setup
5+
export default defineConfig({
46
test: {
5-
environment: 'nuxt',
7+
projects: [
8+
await defineVitestProject({
9+
test: {
10+
name: 'nuxt',
11+
environment: 'nuxt',
12+
},
13+
}),
14+
{
15+
test: {
16+
name: 'types',
17+
include: ['tests/**/*.spec-d.ts'],
18+
typecheck: {
19+
enabled: true,
20+
only: true,
21+
},
22+
},
23+
},
24+
],
625
},
726
})

0 commit comments

Comments
 (0)