-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvitest.config.ts
More file actions
72 lines (71 loc) · 1.89 KB
/
Copy pathvitest.config.ts
File metadata and controls
72 lines (71 loc) · 1.89 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/// <reference types="vitest" />
import path from 'path';
import { loadEnv } from 'vite';
import { defineConfig, configDefaults } from 'vitest/config';
export default defineConfig(({ mode }) => ({
cacheDir: '../../.cache/events-graphql-proxy',
plugins: [],
test: {
environment: 'jsdom',
// mode defines what ".env.{mode}" file to choose if exists
env: loadEnv(mode, process.cwd(), ''),
globals: true, // Makes test, expect, vi global
setupFiles: [
'./vitest-setup.ts',
// 'dotenv/config'
],
include: ['src/**/*.{spec,test}.{js,jsx,ts,tsx}'],
exclude: [...configDefaults.exclude, './.next/', '/__mocks__/'],
reporters: ['json', 'verbose', 'vitest-sonar-reporter'],
outputFile: {
json: 'sonar-report.json',
'vitest-sonar-reporter': 'sonar-report.xml',
},
coverage: {
provider: 'v8', // or 'istanbul'
reporter: ['lcov', 'html', 'text'],
include: ['src/**/*.{ts,tsx,js,jsx}'],
exclude: [
'src/**/*.test.ts',
'src/.next/**',
'**/*.d.ts',
'**/*.json',
'**/*.xml',
'**/*.yaml',
'**/*.md',
'**/*.html',
'**/*.css',
'**/*.properties',
'*.config.*js',
'node_modules/',
'browser-tests/',
'build/',
'codegen.ts',
'src/index.tsx',
'**/__tests__/**',
'**/__snapshots__/**',
'**/*.test.ts',
'**/*.spec.ts',
'**/query.ts',
],
},
},
resolve: {
alias: [
{
find: '@events-helsinki/graphql-proxy-server/$',
replacement: path.resolve(
__dirname,
'../../packages/graphql-proxy-server/src/$1'
),
},
{
find: '@events-helsinki/graphql-proxy-server',
replacement: path.resolve(
__dirname,
'../../packages/graphql-proxy-server/src/index.js'
),
},
],
},
}));