2023-01-26 22:53:39 +08:00
|
|
|
import { configDefaults, defineConfig, UserConfig } from 'vitest/config'
|
2023-02-03 18:12:56 +08:00
|
|
|
import { entries } from './scripts/aliases.js'
|
2023-01-26 15:25:55 +08:00
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
define: {
|
|
|
|
__DEV__: true,
|
|
|
|
__TEST__: true,
|
|
|
|
__VERSION__: '"test"',
|
|
|
|
__BROWSER__: false,
|
|
|
|
__GLOBAL__: false,
|
|
|
|
__ESM_BUNDLER__: true,
|
|
|
|
__ESM_BROWSER__: false,
|
|
|
|
__NODE_JS__: true,
|
|
|
|
__SSR__: true,
|
|
|
|
__FEATURE_OPTIONS_API__: true,
|
|
|
|
__FEATURE_SUSPENSE__: true,
|
|
|
|
__FEATURE_PROD_DEVTOOLS__: false,
|
|
|
|
__COMPAT__: true
|
|
|
|
},
|
|
|
|
resolve: {
|
2023-02-03 05:00:06 +08:00
|
|
|
alias: entries
|
2023-01-26 15:25:55 +08:00
|
|
|
},
|
|
|
|
test: {
|
|
|
|
globals: true,
|
2023-02-21 22:46:43 +08:00
|
|
|
// disable threads on GH actions to speed it up
|
|
|
|
threads: !process.env.GITHUB_ACTIONS,
|
2023-01-26 21:35:50 +08:00
|
|
|
setupFiles: 'scripts/setupVitest.ts',
|
2023-01-26 22:22:43 +08:00
|
|
|
environmentMatchGlobs: [
|
|
|
|
['packages/{vue,vue-compat,runtime-dom}/**', 'jsdom']
|
2023-01-26 22:53:39 +08:00
|
|
|
],
|
2023-01-27 14:52:41 +08:00
|
|
|
sequence: {
|
|
|
|
hooks: 'list'
|
|
|
|
},
|
2023-01-26 22:53:39 +08:00
|
|
|
coverage: {
|
|
|
|
provider: 'istanbul',
|
|
|
|
reporter: ['text', 'html'],
|
|
|
|
exclude: [
|
|
|
|
...configDefaults.coverage.exclude!,
|
|
|
|
// DOM transitions are tested via e2e so no coverage is collected
|
|
|
|
'packages/runtime-dom/src/components/Transition*',
|
|
|
|
// mostly entries
|
|
|
|
'packages/vue-compat/**'
|
|
|
|
]
|
|
|
|
}
|
2023-01-26 15:25:55 +08:00
|
|
|
}
|
2023-01-26 22:53:39 +08:00
|
|
|
}) as UserConfig
|