-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
51 lines (47 loc) · 1.66 KB
/
Copy pathvitest.config.ts
File metadata and controls
51 lines (47 loc) · 1.66 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import { configDefaults } from 'vitest/config'
import { importAliases } from './import-aliases'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
resolve: { alias: importAliases },
test: {
setupFiles: './vitest.setup.ts',
environment: 'jsdom',
exclude: [...configDefaults.exclude, '**/.d2/**', '**/.claude/**'],
onConsoleLog(log, type) {
// Suppress Highcharts warnings
if (
type === 'stderr' &&
log.includes(
'Highcharts warning #26: www.highcharts.com/errors/26/'
)
) {
return false
}
// Suppress styled-jsx StyleSheet warnings from DHIS2 UI components
if (type === 'stderr' && log.includes('StyleSheet: illegal rule')) {
return false
}
// This message was coming from analytics so we can't fix it
if (
type === 'stdout' &&
log.includes(
'Button component has no children but is missing title and ariaLabel attribute'
)
) {
return false
}
// For tests this is not helpful. You may want to assert the whole state
if (
type === 'stderr' &&
log.includes(
'Selector unknown returned the root state when called. This can lead to unnecessary rerenders.'
)
) {
return false
}
},
},
})