-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathvitest.config.mts
53 lines (52 loc) · 1.55 KB
/
vitest.config.mts
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
51
52
53
import path from 'path'
import { quasar, transformAssetUrls } from '@quasar/vite-plugin'
import vue from '@vitejs/plugin-vue'
import tsconfigPaths from 'vite-tsconfig-paths'
import { configDefaults, defineConfig } from 'vitest/config'
// https://vitejs.dev/config/
export default defineConfig({
test: {
environment: 'happy-dom',
setupFiles: 'test/vitest/setup-file.ts', // additional info see https://stackoverflow.com/questions/72260793/how-to-mock-stub-vue-i18n
testTimeout: 50000,
hookTimeout: 50000,
include: [
// Matches vitest tests in any subfolder of 'src' or into 'test/vitest/__tests__'
// Matches all files with extension 'js', 'jsx', 'ts' and 'tsx'
'src/**/*.vitest.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}',
'test/vitest/__tests__/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}',
],
coverage: {
reporter: ['text', 'lcov', 'json-summary', 'json'],
exclude: [
...configDefaults.exclude,
'**/*.config.{js,ts}',
'e2e/**',
'.quasar/**',
'playwright-report/**',
'docs/**',
'tools/**',
],
},
// https://vitest.dev/guide/browser.html
browser: {
enabled: false,
name: 'chrome', // browser name is required
},
},
resolve: {
//conditions: process.env.VITEST ? ['node'] : []
alias: {
src: path.resolve(__dirname, './src'),
},
},
plugins: [
tsconfigPaths(),
vue({
template: { transformAssetUrls },
}),
quasar({
sassVariables: 'src/quasar-variables.scss',
}),
],
})