generated from josephgoksu/prime-react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
28 lines (27 loc) · 962 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
const { defaults: tsjPreset } = require('ts-jest/presets');
module.exports = {
...tsjPreset,
preset: 'react-native',
setupFiles: ['./jest/jestSetupFile.js'],
transform: {
...tsjPreset.transform,
'\\.js$': '<rootDir>/node_modules/react-native/jest/preprocessor.js',
},
transformIgnorePatterns: ['node_modules/(?!@react-native|react-native)'],
globals: {
'ts-jest': {
babelConfig: true,
},
},
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
testPathIgnorePatterns: ['/node_modules/', '/e2e'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/jest/assetsTransformer.js',
'\\.(css|less)$': '<rootDir>/jest/assetsTransformer.js',
},
// This is the only part which you can keep
// from the above linked tutorial's config:
cacheDirectory: '.jest/cache',
};