-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
30 lines (28 loc) · 1 KB
/
jest.config.js
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
const config = require('config');
const CONFIG = config.has('public') ? config.get('public') : {};
module.exports = {
roots: ["<rootDir>/src"],
transform: {
"^.+\\.tsx?$": "ts-jest"
},
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
snapshotSerializers: ["enzyme-to-json/serializer"],
setupFilesAfterEnv: ["<rootDir>/src/app/setup-tests.ts"],
moduleNameMapper: {
"@config(.*)$": "<rootDir>/src/app/config.ts",
"@components(.*)$": "<rootDir>/src/app/components/$1",
"@models(.*)$": "<rootDir>/src/app/models/$1",
"@services(.*)$": "<rootDir>/src/app/services/$1",
"@helpers(.*)$": "<rootDir>/src/app/helpers/$1",
"@hoc(.*)$": "<rootDir>/src/app/hoc/$1",
"@assets(.*)$": "<rootDir>/src/assets/$1",
// mocks
"i18next": "<rootDir>/src/app/helpers/__mocks__/i18n.ts",
"\\.css$": "<rootDir>/__mocks__/style-mocks.ts"
},
resolver: null,
globals: {
CONFIG: JSON.stringify(CONFIG)
}
}