-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjest.config.js
29 lines (29 loc) · 1.17 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
module.exports = {
projects: [
{
displayName: 'web',
preset: 'jest-expo', // Use jest-expo preset for Expo projects
// transform: {
// '^.+\\.js$': 'babel-jest', // Transpile JS files using babel-jest
// '^.+\\.ts$': 'ts-jest', // If you're using TypeScript
// },
moduleNameMapper: {
'^react-native$': 'react-native-web', // Alias react-native to react-native-web
},
testEnvironment: 'jsdom', // Set jsdom for web tests
testMatch: [
'<rootDir>/src/**/*.test.web.ts', // Match web-specific test files
// '<rootDir>/src/**/*.test.ts', // Match multi-platform test files
],
},
{
displayName: 'native',
preset: 'jest-expo', // Use the default React Native preset
testEnvironment: 'node', // Use Node.js for native tests
testMatch: [
'<rootDir>/src/**/*.test.ts', // Match multi-platform test files
// '<rootDir>/src/**/*.test.native.ts', // Match native-specific test files
],
},
],
};