forked from alibaba/ice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vitest.config.ts
39 lines (37 loc) · 1.04 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
import { defineConfig } from 'vitest/config';
import { getHookFiles } from './packages/ice/esm/requireHook.js';
const moduleNameMapper = getHookFiles().reduce((mapper, [id, value]) => {
mapper[`^${id}$`] = value;
return mapper;
}, {});
export default defineConfig({
resolve: {
alias: { ...moduleNameMapper },
},
test: {
testTimeout: 120000,
// To avoid error `Segmentation fault (core dumped)` in CI environment, disable threads
// ref: https://github.com/vitest-dev/vitest/issues/317
threads: false,
exclude: [
'**/node_modules/**',
'**/esm/**',
'**/tests/fixtures/**',
'examples/**',
],
coverage: {
reporter: ['cobertura', 'text'],
include: ['**/packages/**'],
exclude: [
'**/bundles/compiled/**',
// App runtime has been tested by unit test case
'**/packages/runtime/esm/**',
'**/packages/route-manifest/esm/**',
'**/packages/miniapp-runtime/esm/**',
'**/tests/**',
],
},
environment: 'node',
},
mode: 'test',
});