-
Notifications
You must be signed in to change notification settings - Fork 12
/
vite.config.ts
42 lines (35 loc) · 1.07 KB
/
vite.config.ts
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
/// <reference lib="esnext" />
/// <reference types="vitest" />
import vue from '@vitejs/plugin-vue'
import { defineConfig } from './config/vite'
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'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, '')))
// eslint-disable-next-line no-control-regex
if (log.replace(/\u001B\[.*?m/g, '').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"'
]