-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathvitest.config.mjs
More file actions
33 lines (31 loc) · 1.21 KB
/
vitest.config.mjs
File metadata and controls
33 lines (31 loc) · 1.21 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
import { defineConfig } from 'vitest/config'
import vue from '@vitejs/plugin-vue'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
const __dirname = fileURLToPath(new URL('.', import.meta.url))
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
// map nextcloud packages to test mocks so component tests keep using the light mocks
'@nextcloud/axios': path.resolve(__dirname, 'src/test/__mocks__/@nextcloud/axios.js'),
'@nextcloud/router': path.resolve(__dirname, 'src/test/__mocks__/@nextcloud/router.js'),
'@nextcloud/l10n': path.resolve(__dirname, 'src/test/__mocks__/@nextcloud/l10n.js'),
'@nextcloud/dialogs': path.resolve(__dirname, 'src/test/__mocks__/@nextcloud/dialogs.js'),
'@nextcloud/vue': path.resolve(__dirname, 'src/test/__mocks__/@nextcloud/vue.js'),
},
},
test: {
environment: 'jsdom',
globals: true,
setupFiles: ['./src/test/setup-vitest.js'],
include: ['src/test/**/*.spec.js',],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'lcov', 'html'],
include: ['src/**/*.{js,vue}'],
exclude: ['src/test/**', 'node_modules/**'],
},
},
})