-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjest.config.js
More file actions
69 lines (59 loc) · 1.53 KB
/
jest.config.js
File metadata and controls
69 lines (59 loc) · 1.53 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/**
* written by: Team QuickPay
* tested by: Team QuickPay
* debugged by: Team QuickPay
* Notes: Contributions were shared, see GitHub history for commit details.
* Unit Tests for UserSyncService
*/
/**
* Jest Configuration for QuickPay Mobile App
*
* This configuration sets up Jest testing framework for React Native
* with TypeScript support.
*/
module.exports = {
// Use ts-jest preset for TypeScript support
preset: 'react-native',
// Transform TypeScript files
transform: {
'^.+\\.tsx?$': ['ts-jest', {
tsconfig: {
jsx: 'react',
},
}],
},
// File extensions to consider
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
// Setup files to run before tests
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
// Module name mapper for path aliases
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/$1',
},
// Test match patterns
testMatch: [
'**/__tests__/**/*.test.[jt]s?(x)',
'**/?(*.)+(spec|test).[jt]s?(x)',
],
// Coverage configuration
collectCoverageFrom: [
'services/**/*.{ts,tsx}',
'models/**/*.{ts,tsx}',
'components/**/*.{ts,tsx}',
'app/**/*.{ts,tsx}',
'!**/*.d.ts',
'!**/node_modules/**',
],
// Test environment
testEnvironment: 'node',
// Ignore patterns
testPathIgnorePatterns: [
'/node_modules/',
'/android/',
'/ios/',
],
// Transform ignore patterns for node_modules
transformIgnorePatterns: [
'node_modules/(?!(react-native|@react-native|expo|@expo|@clerk|@supabase|react-native-url-polyfill)/)',
],
};