mirror of
https://github.com/alibaba/ice.git
synced 2024-10-23 07:04:52 +08:00
25c7584326
* 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
41 lines
1.1 KiB
TypeScript
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',
|
|
});
|