-
Notifications
You must be signed in to change notification settings - Fork 48
/
jest.config.js
37 lines (36 loc) · 1.22 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
31
32
33
34
35
36
37
const { defaults: tsJestConfig } = require('ts-jest/presets');
module.exports = {
...tsJestConfig,
preset: 'react-native',
transformIgnorePatterns: [
'node_modules/(?!react-native|@react-native|@react-native-community|realm|@react-native-firebase|i18n-js)',
],
setupFiles: ['./jest.setup.js'],
collectCoverage: true,
coverageReporters: ['lcov'],
globals: {
window: {},
},
transform: {
'^.+\\.(js|jsx)$': '<rootDir>/node_modules/babel-jest',
'\\.(ts|tsx)$': [
'ts-jest',
{
babelConfig: false,
isolatedModules: true,
tsconfig: 'tsconfig.jest.json',
},
],
},
testMatch: ['**/__tests__/**/?(*.)+(spec|test).(js|ts|tsx)'],
testPathIgnorePatterns: ['\\.snap$', '<rootDir>/node_modules/', '<rootDir>/e2e/'],
cacheDirectory: '.jest/cache',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'ios.ts', 'ios.tsx', 'android.ts', 'android.tsx'],
maxWorkers: 1,
testTimeout: 20000,
moduleNameMapper: {
// Jest does not support package.json exports.
uuid: require.resolve('uuid'),
'@realm/fetch': require.resolve('@realm/fetch'),
},
};