forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
42 lines (42 loc) · 2 KB
/
jest.config.js
File metadata and controls
42 lines (42 loc) · 2 KB
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
41
42
const testFileExtension = 'ts?(x)';
module.exports = {
preset: 'jest-expo',
collectCoverageFrom: ['<rootDir>/src/**/*.{ts,tsx,js,jsx}', '!<rootDir>/src/**/__mocks__/**', '!<rootDir>/src/**/tests/**', '!**/*.d.ts'],
testMatch: [
`<rootDir>/tests/ui/**/*.${testFileExtension}`,
`<rootDir>/tests/unit/**/*.${testFileExtension}`,
`<rootDir>/tests/actions/**/*.${testFileExtension}`,
`<rootDir>/tests/navigation/**/*.${testFileExtension}`,
`<rootDir>/?(*.)+(spec|test).${testFileExtension}`,
],
transform: {
'^.+\\.[jt]sx?$': 'babel-jest',
'^.+\\.svg?$': 'jest-transformer-svg',
},
transformIgnorePatterns: [
'<rootDir>/node_modules/(?!.*(react-native|expo|@noble|react-navigation|uuid|@shopify\/flash-list).*/)',
// Prevent Babel from transforming worklets in this file so they are treated as normal functions, otherwise FormatSelectionUtilsTest won't run.
'<rootDir>/node_modules/@expensify/react-native-live-markdown/lib/commonjs/parseExpensiMark.js',
],
testPathIgnorePatterns: ['<rootDir>/node_modules'],
globals: {
__DEV__: true,
WebSocket: {},
},
fakeTimers: {
enableGlobally: true,
doNotFake: ['nextTick'],
},
testEnvironment: 'jsdom',
setupFiles: ['<rootDir>/jest/setup.ts', './node_modules/@react-native-google-signin/google-signin/jest/build/setup.js'],
setupFilesAfterEnv: ['<rootDir>/jest/setupAfterEnv.ts', '<rootDir>/tests/perf-test/setupAfterEnv.ts'],
cacheDirectory: '<rootDir>/.jest-cache',
coverageReporters: ['json', 'lcov', 'text-summary'],
moduleNameMapper: {
'\\.(lottie)$': '<rootDir>/__mocks__/fileMock.ts',
'^group-ib-fp$': '<rootDir>/__mocks__/group-ib-fp.ts',
'@noble/ed25519': '<rootDir>/node_modules/@noble/ed25519/index.ts',
'@noble/hashes/(.*)': '<rootDir>/node_modules/@noble/hashes/src/$1.ts',
'^parse-imports-exports$': '<rootDir>/node_modules/parse-imports-exports/index.cjs',
},
};