-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.cjs
25 lines (24 loc) · 828 Bytes
/
jest.config.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const generateJestConfig = ({ esModules }) => {
const esModulesList = Array.isArray(esModules) ? esModules.join('|') : esModules
return {
coveragePathIgnorePatterns: ['<rootDir>/(.*)/dist'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
preset: 'ts-jest/presets/default-esm',
setupFilesAfterEnv: ['jest-sorted', 'jest-extended/all'],
testRegex: '(/__tests__/.*|(\\.|/)((!perf\\.)test|spec))\\.tsx?$',
testTimeout: 20000,
transform: {
[`(${esModulesList}).+\\.js$`]: 'babel-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: 'tsconfig.test.json',
},
],
},
transformIgnorePatterns: [`./node_modules/(?!${esModulesList})`],
}
}
module.exports = generateJestConfig({ esModules: ['is-ip', 'ip-regex', 'lodash-es', 'uuid'] })