ice/vitest.config.ts

37 lines
954 B
TypeScript
Raw Normal View History

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: {
// 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/**',
'**/tests/**',
],
},
2022-06-27 14:08:55 +08:00
environment: 'jsdom',
},
2022-06-29 17:39:47 +08:00
mode: 'test',
});