vitest.config.m.ts
1.01 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
import { defineVitestConfig } from '@nuxt/test-utils/config'
import vue from '@vitejs/plugin-vue'
import { fileURLToPath } from 'node:url'
export default defineVitestConfig({
/**
* Documentation here : https://nuxt.com/docs/getting-started/testing
* any custom Vitest config you require
*/
test: {
environment: 'nuxt',
globals: true,
// you can optionally set Nuxt-specific environment options
environmentOptions: {
nuxt: {
rootDir: fileURLToPath(new URL('./', import.meta.url)),
domEnvironment: 'happy-dom', // 'happy-dom' (default) or 'jsdom'
overrides: {
// other Nuxt config you want to pass
},
mock: {
intersectionObserver: true,
indexedDb: true,
}
},
},
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
}
},
resolve: {
alias: {
'~': fileURLToPath(new URL('./', import.meta.url)),
'@': fileURLToPath(new URL('./', import.meta.url)),
}
}
})