/
vitest.config.mts
41 lines (34 loc) · 1.02 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
/// <reference lib="esnext" />
import vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vitest/config'
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'sefirot/': new URL('./lib/', import.meta.url).pathname,
'tests/': new URL('./tests/', import.meta.url).pathname
}
},
test: {
globals: true,
environment: 'happy-dom',
testTimeout: 2000,
setupFiles: ['./tests/vitest.setup.ts'],
coverage: {
provider: 'v8',
all: true,
include: ['lib'],
reporter: ['html', 'json', 'lcov', 'text-summary']
},
onConsoleLog(log, type) {
if (type !== 'stderr') { return }
ignore.forEach((s) => (log = log.replaceAll(s, '')))
if (log.trim() === '') { return false }
}
}
})
const ignore = [
'[Vue warn]: inject() can only be used inside setup() or functional components.',
'[Vue Router warn]: No match found for location with path "about"',
'[Vue Router warn]: No match found for location with path "https://example.com"'
]