ice/vitest.config.ts
Homyee King 25c7584326
feat: dynamic API (#6831)
* chore: save

* feat: basic dynamic

* feat: export from ice/runtime

* test: with-dynamic

* test(with-dynamic): name export

* feat: use useMounted

* chore: cmt

* chore: up lock file

* chore: use universal-env

* fix: ci

* Revert "chore: use universal-env"

This reverts commit 98f5dff99f.

* chore: optimize logic
2024-03-20 14:44:21 +08:00

41 lines
1.1 KiB
TypeScript

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,
hookTimeout: 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',
});