forked from XYOracleNetwork/api-archivist-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.cjs
33 lines (32 loc) · 907 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
26
27
28
29
30
31
32
33
const generateJestConfig = ({ esModules }) => {
const esModuleslist = Array.isArray(esModules) ? esModules.join('|') : esModules
return {
coverageThreshold: {
global: {
branches: 50,
functions: 80,
lines: 70,
statements: 70,
},
},
globals: {
'ts-jest': {
tsconfig: 'tsconfig.test.json',
},
},
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
preset: 'ts-jest/presets/default-esm',
setupFiles: ['dotenv/config'],
setupFilesAfterEnv: ['jest-sorted'],
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$',
testTimeout: 15000,
transform: {
[`(${esModuleslist}).+\\.js$`]: 'babel-jest',
'^.+\\.tsx?$': 'ts-jest',
},
transformIgnorePatterns: [`./node_modules/(?!${esModuleslist})`],
}
}
module.exports = generateJestConfig({ esModules: ['is-ip', 'ip-regex'] })