-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathjest.config.js
38 lines (36 loc) · 913 Bytes
/
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
31
32
33
34
35
36
37
38
// "jest": {
// "preset": "react-native",
// "moduleFileExtensions": [
// "ts",
// "tsx",
// "js"
// ],
// "transform": {
// "^.+\\.(js)$": "babel-jest",
// "\\.(ts|tsx)$": "ts-jest"
// },
// "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
// "testPathIgnorePatterns": [
// "\\.snap$",
// "<rootDir>/node_modules/"
// ],
// "cacheDirectory": ".jest/cache"
// }
const { defaults: tsjPreset } = require('ts-jest/presets');
module.exports = {
...tsjPreset,
preset: 'react-native',
transform: {
...tsjPreset.transform,
'^.+\\.(js|ts|tsx)$':
'<rootDir>/node_modules/react-native/jest/preprocessor.js',
},
globals: {
'ts-jest': {
babelConfig: true,
},
},
// This is the only part which you can keep
// from the above linked tutorial's config:
cacheDirectory: '.jest/cache',
};