1 Star 0 Fork 0

hub-mirror / Memex

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
.jest-config.js 1.19 KB
一键复制 编辑 原始数据 按行查看 历史
const { jsWithTs: tsjPreset } = require('ts-jest/presets')
const externalTsModules = require('./build/external').externalTsModules
const externalTsModuleMappings = {}
for (const [alias, relPath] of Object.entries(externalTsModules)) {
Object.assign(externalTsModuleMappings, {
[`^${alias}$`]: `<rootDir>/external/${relPath}/ts`,
[`^${alias}/lib/(.*)`]: `<rootDir>/external/${relPath}/ts/$1`,
})
}
module.exports = {
globals: {
'ts-jest': {
tsConfig: 'tsconfig.jest.json',
babelConfig: true,
},
browser: {},
},
testMatch: ['<rootDir>/src/**/*.test.(js|jsx|ts|tsx)'],
rootDir: '.',
transform: {
...tsjPreset.transform,
},
modulePaths: ['<rootDir>'],
moduleNameMapper: {
'\\.(css|less)$': 'identity-obj-proxy',
...externalTsModuleMappings,
},
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx'],
setupFiles: ['jest-webextension-mock', './setupJest.js'],
unmockedModulePathPatterns: [
'<rootDir>/node_modules/react',
'<rootDir>/node_modules/react-dom',
'<rootDir>/node_modules/react-addons-test-utils',
'<rootDir>/node_modules/fbjs',
],
}
1
https://gitee.com/hub-mirror/Memex.git
git@gitee.com:hub-mirror/Memex.git
hub-mirror
Memex
Memex
develop

搜索帮助

53164aa7 5694891 3bd8fe86 5694891