-
Notifications
You must be signed in to change notification settings - Fork 24
/
jest.config.js
25 lines (24 loc) · 890 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
const { defaults: tsjPreset } = require('ts-jest/presets')
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'react-native',
transform: {
'^.+\\.jsx$': 'babel-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: 'tsconfig.spec.json',
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
testRegex: '(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$',
testPathIgnorePatterns: ['\\.snap$', '<rootDir>/node_modules/'],
transformIgnorePatterns: ['node_modules/(?!(@react-native|react-native|react-native-vector-icons))'],
cacheDirectory: '.jest/cache',
setupFiles: ['./jest-setup.js'],
setupFilesAfterEnv: [
'./jest-tests-setup.ts',
'./node_modules/react-native-gesture-handler/jestSetup.js', // src: https://docs.swmansion.com/react-native-gesture-handler/docs/guides/testing
],
}