-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathvitest.config.ts
More file actions
73 lines (70 loc) · 1.78 KB
/
Copy pathvitest.config.ts
File metadata and controls
73 lines (70 loc) · 1.78 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
73
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck
import { resolve } from 'node:path';
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vitest/config';
const projectRoot = resolve(__dirname);
const projectAliases = [
'abi',
'config',
'consts',
'features',
'modules',
'networks',
'pages',
'providers',
'scripts',
'shared',
'styles',
'types',
'utils',
'utilsApi',
].map((dirName) => ({
find: dirName,
replacement: resolve(projectRoot, dirName),
}));
export default defineConfig({
plugins: [react()],
resolve: {
alias: [
...projectAliases,
{
find: 'assets',
replacement: resolve(projectRoot, 'assets'),
},
{
find: 'REMOTE_CONFIG_MANIFEST.json',
replacement: resolve(projectRoot, 'REMOTE_CONFIG_MANIFEST.json'),
},
{
find: 'build-info.json',
replacement: resolve(projectRoot, 'build-info.json'),
},
{
find: 'env-dynamics.mjs',
replacement: resolve(projectRoot, 'env-dynamics.mjs'),
},
],
},
test: {
environment: 'node',
exclude: ['test/**', 'node_modules/**', '.next/**'],
globals: true,
include: ['**/*.{test,tests,spec}.{ts,tsx,js,jsx}'],
setupFiles: ['./vitest.setup.ts'],
coverage: {
provider: 'v8',
reportsDirectory: './coverage',
reporter: ['text', 'html', 'lcov'],
// Report only files actually exercised by tests. The suite is sparse, so
// instrumenting the whole project would drown the summary in 0%-covered
// files. Pass an explicit path (e.g. `--coverage.all`) for a full sweep.
all: false,
exclude: [
'**/*.{test,tests,spec}.{ts,tsx,js,jsx}',
'**/__tests__/**',
'**/*.d.ts',
],
},
},
});