-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathvitest.config.ts
39 lines (33 loc) · 945 Bytes
/
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
/// <reference types="vitest" />
import { defineConfig } from 'vitest/config'
import { fileURLToPath } from 'url'
import tsConfig from './tsconfig.json'
const alias = Object.entries(tsConfig.compilerOptions.paths).reduce(
(result, [key, value]) => ({
...result,
[key]: fileURLToPath(new URL(value[0], import.meta.url)),
}),
{},
)
const { CI } = process.env
export default defineConfig({
ssr: {
noExternal: ['@gnosis.pm/zodiac'],
},
test: {
alias,
environment: 'happy-dom',
setupFiles: ['./vitest.setup.mts', '@zodiac/test-utils/setup-chrome-mock'],
include: ['./src/**/*.{spec,test}.{ts,tsx}'],
mockReset: true,
clearMocks: true,
coverage: {
skipFull: true,
enabled: CI != null,
reportOnFailure: CI != null,
reporter: CI ? ['json', 'json-summary'] : undefined,
include: ['**/src/**/*.{ts,tsx}'],
exclude: ['**/src/**/*.spec.{ts,tsx}'],
},
},
})