-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathvitest.config.ts
46 lines (44 loc) · 1.1 KB
/
vitest.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
43
44
45
46
import react from '@vitejs/plugin-react';
import path from 'path';
const config = {
plugins: [react()],
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./src/test/setup.ts'],
coverage: {
provider: 'v8',
},
server: {
deps: {
inline: ['vitest-canvas-mock', '@patternfly', '@monaco-editor'],
},
},
testTimeout: 10000,
fileParallelism: false,
exclude: ['./pkg/lib/**', '**/node_modules/**', '**/dist/**'],
},
reporters: ['default', 'junit'],
outputFile: {
junit: './coverage/junit.xml',
},
resolve: {
mainFields: ['module'],
alias: {
// we have to point vitest to the mocks for `cockpit` and `cockpit/fsinfo`
// by using aliases. This allows vitest to resolve these two packages
// and allows the tests to pass
cockpit: path.resolve(__dirname, 'src/test/mocks/cockpit'),
'cockpit/fsinfo': path.resolve(
__dirname,
'src/test/mocks/cockpit/fsinfo'
),
},
},
esbuild: {
loader: 'tsx',
include: /src\/.*\.[tj]sx?$/,
exclude: [],
},
};
export default config;