forked from nuxt/nuxt
-
Notifications
You must be signed in to change notification settings - Fork 10
/
vitest.config.ts
32 lines (31 loc) · 1.21 KB
/
vitest.config.ts
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
import { resolve } from 'pathe'
import { configDefaults, coverageConfigDefaults, defineConfig } from 'vitest/config'
import { isWindows } from 'std-env'
// import codspeedPlugin from '@codspeed/vitest-plugin'
export default defineConfig({
// plugins: [codspeedPlugin()],
resolve: {
alias: {
'#build/nuxt.config.mjs': resolve('./test/mocks/nuxt-config'),
'#internal/nuxt/paths': resolve('./test/mocks/paths'),
'#build/app.config.mjs': resolve('./test/mocks/app-config'),
'#app': resolve('./packages/nuxt/dist/app'),
},
},
test: {
globalSetup: './test/setup.ts',
setupFiles: ['./test/setup-env.ts'],
coverage: {
exclude: [...coverageConfigDefaults.exclude, 'packages/nuxt/src/app', 'playground', '**/test/', 'scripts', 'vitest.nuxt.config.ts'],
},
testTimeout: isWindows ? 60000 : 10000,
// Excluded plugin because it should throw an error when accidentally loaded via Nuxt
exclude: [...configDefaults.exclude, 'nuxt/**', '**/test.ts', '**/this-should-not-load.spec.js'],
poolOptions: {
threads: {
maxThreads: process.env.TEST_ENV === 'dev' ? 1 : undefined,
minThreads: process.env.TEST_ENV === 'dev' ? 1 : undefined,
},
},
},
})