forked from portainer/portainer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.mts
More file actions
42 lines (41 loc) · 1.24 KB
/
vitest.config.mts
File metadata and controls
42 lines (41 loc) · 1.24 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
import { defineConfig } from 'vitest/config';
import tsconfigPaths from 'vite-tsconfig-paths';
import svgr from 'vite-plugin-svgr';
export default defineConfig({
build: {
// force tests to import svg as url
// TODO consider removing when moving from webpack
assetsInlineLimit: 0,
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: [
'./app/setup-tests/setup-websocket.ts',
'./app/setup-tests/setup-rtl.ts',
'./app/setup-tests/setup-msw.ts',
'./app/setup-tests/stub-modules.ts',
'./app/setup-tests/setup.ts',
'./app/setup-tests/setup-codemirror.ts',
],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
exclude: ['node_modules/', 'app/setup-tests/global-setup.js'],
},
bail: 2,
include: ['./app/**/*.test.ts', './app/**/*.test.tsx'],
env: {
PORTAINER_EDITION: 'CE',
},
server: {
deps: {
inline: [/@radix-ui/, /codemirror-json-schema/], // https://github.com/radix-ui/primitives/issues/2974#issuecomment-2186808459
},
},
onConsoleLog(log) {
return !/Can't perform a React state update on an unmounted component/.test(log);
},
},
plugins: [svgr({ include: /\?c$/ }), tsconfigPaths()],
});