1 Star 0 Fork 635

black/NocoBase

forked from NocoBase/NocoBase 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vitest.config.ts 1.38 KB
一键复制 编辑 原始数据 按行查看 历史
张中合 提交于 2023-10-27 15:32 . chore: optimize locators (#2833)
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vitest/config';
import tsConfigPaths from './tsconfig.paths.json';
const paths = tsConfigPaths.compilerOptions.paths;
const alias = Object.keys(paths).reduce<{ find: string; replacement: string }[]>((acc, key) => {
if (key !== '@@/*') {
const value = paths[key][0];
acc.push({
find: key,
replacement: value,
});
}
return acc;
}, []);
export default defineConfig({
plugins: [react()],
resolve: {
mainFields: ['module'],
},
define: {
'process.env.__TEST__': true,
'process.env.__E2E__': false,
},
test: {
globals: true,
setupFiles: 'scripts/vitest.setup.ts',
environment: 'jsdom',
css: false,
threads: true,
alias: [
{ find: 'testUtils', replacement: 'testUtils.ts' },
{ find: /^~antd\/(.*)/, replacement: 'antd/$1' },
...alias,
],
include: ['packages/**/{dumi-theme-nocobase,sdk,client,utils}/**/__tests__/**/*.{test,spec}.{ts,tsx}'],
exclude: [
'**/node_modules/**',
'**/dist/**',
'**/lib/**',
'**/es/**',
'**/e2e/**',
'**/{vitest,commitlint}.config.*',
],
testTimeout: 300000,
bail: 1,
// 在 GitHub Actions 中不输出日志
silent: !!process.env.GITHUB_ACTIONS,
server: {
deps: {
inline: ['@juggle/resize-observer', 'clsx'],
},
},
},
});
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/White_WorkStation/nocobase.git
git@gitee.com:White_WorkStation/nocobase.git
White_WorkStation
nocobase
NocoBase
main

搜索帮助