-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
40 lines (37 loc) · 1.56 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
38
39
40
const baseConfig = require('jest-expo/jest-preset');
/** @type {import('@jest/types').Config.InitialOptions} */
const config = {
...baseConfig,
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
transform: {
...baseConfig.transform,
'^.+\\.(js|ts)$': '<rootDir>/node_modules/babel-jest',
},
testRegex: '(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$',
testPathIgnorePatterns: ['\\.snap$', '<rootDir>/node_modules/'],
cacheDirectory: '.cache/jest',
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'],
coveragePathIgnorePatterns: ['/node_modules/'],
clearMocks: true,
// fakeTimers: {
// enableGlobally: true
// },
watchPlugins: [
"jest-watch-typeahead/filename",
"jest-watch-typeahead/testname",
],
reporters: ["default", "github-actions"],
preset: "jest-expo",
transformIgnorePatterns: [
"node_modules/(?!(jest-)?@react-native|react-native|react-clone-referenced-element|@react-native-community|expo(nent)?|@expo(nent)?/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|@sentry/.*|sentry-expo|native-base)",
],
setupFiles: [
'./node_modules/@testing-library/react-native/jest-preset/save-promise.js',
...baseConfig.setupFiles,
'./jest.setup.js',
'./node_modules/react-native-gesture-handler/jestSetup.js',
'./node_modules/@testing-library/react-native/jest-preset/restore-promise.js',
],
setupFilesAfterEnv: ['./jestCustomMatchers.ts', './jest.setup.after.js', './jest.setup.js',],
};
module.exports = config;