-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathvitest.config.ts
More file actions
50 lines (49 loc) · 1.79 KB
/
vitest.config.ts
File metadata and controls
50 lines (49 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { resolve } from 'pathe'
import { defineConfig } from 'vitest/config'
export default defineConfig({
test: {
globals: true,
environment: 'node',
include: ['tests/**/*.test.ts'],
exclude: [
'**/node_modules/**',
'**/vercube/**',
'**/dist/**',
'tests/e2e/**', // E2E tests use vitest.e2e.config.ts
],
testTimeout: 30000,
globalSetup: ['./tests/global-setup.ts'],
setupFiles: ['./tests/setup.ts'],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html', 'json-summary'],
include: ['src/**/*.ts'],
exclude: [
'src/**/*.d.ts',
'src/**/index.ts', // Barrel/re-export files
'src/types/**',
'src/cli/**', // CLI tested manually
'src/stubs/**', // Stub files
'src/core/types/**', // Type definitions only
'src/nitro/types/**', // Type definitions only
'src/nitro/routes/**', // Route handlers tested via integration
'src/nitro/virtual/**', // Virtual module generators
'src/nuxt.ts', // Nuxt-specific (needs Nuxt to test)
'src/core/codegen/runtime.ts', // Runtime config generation
],
},
},
resolve: {
alias: {
'~': resolve(__dirname, './src'),
'@': resolve(__dirname, './src'),
// Map nitro-graphql/* imports to source files (no build required)
'nitro-graphql/config': resolve(__dirname, './src/config.ts'),
'nitro-graphql/define': resolve(__dirname, './src/define.ts'),
'nitro-graphql/pubsub': resolve(__dirname, './src/core/pubsub/index.ts'),
'nitro-graphql/native': resolve(__dirname, './tests/mocks/native.ts'),
// Force single graphql instance to avoid "Cannot use GraphQL* from another module" errors
'graphql': resolve(__dirname, './node_modules/graphql'),
},
},
})