加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
jest.config.js 1.39 KB
一键复制 编辑 原始数据 按行查看 历史
hxh2010 提交于 2024-04-24 20:01 . fix: [popper]fix bug
const transformIgnorePatterns = [
'/dist/',
// Ignore modules without es dir.
// Update: @babel/runtime should also be transformed
'node_modules/(?!.*@(babel|kdcloudjs|popperjs))[^/]+?/(?!(es|node_modules)/)',
]
module.exports = {
verbose: true,
preset: 'ts-jest', // https://kulshekhar.github.io/ts-jest/user/config/
setupFiles: ['./tests/setup.js'],
setupFilesAfterEnv: ['./tests/setupAfterEnv.ts'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
modulePathIgnorePatterns: ['/_site/'],
moduleNameMapper: {
'\\.(css|less)$': 'identity-obj-proxy',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/tests/__mocks__/fileMock.js',
},
transform: {
'^.+\\.(js|jsx)$': 'babel-jest',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/tests/fileTransform.js',
},
testPathIgnorePatterns: ['/node_modules/', 'dekko', 'node', 'image.test.tsx', '/lib/', '/es/'],
testRegex: '.*\\.test\\.(j|t)sx?$',
collectCoverageFrom: [
'components/**/*.{ts,tsx}',
'!components/*/style/index.tsx',
'!components/style/index.tsx',
'!components/*/locale/index.tsx',
'!components/*/__tests__/type.test.tsx',
'!components/**/*/interface.{ts,tsx}',
],
transformIgnorePatterns,
snapshotSerializers: ['enzyme-to-json/serializer'],
testURL: 'http://localhost',
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化