Skip to content

Commit

Permalink
Make JS and TS tests independent of react-native package name
Browse files Browse the repository at this point in the history
  • Loading branch information
thymikee committed Nov 29, 2023
1 parent 47e009e commit 20becd3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
3 changes: 3 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ module.exports = {
platforms: ['ios', 'android'],
},
moduleNameMapper: {
// These mappers allow out-of-tree platforms tests to seamlessly resolve RN imports
'^react-native/(.*)': '<rootDir>/packages/react-native/$1',
'^react-native$': '<rootDir>/packages/react-native/index.js',
// This module is internal to Meta and used by their custom React renderer.
// In tests, we can just use a mock.
'^ReactNativeInternalFeatureFlags$':
Expand Down
27 changes: 15 additions & 12 deletions packages/react-native/types/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"types": [],
"jsx": "react",
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"paths": {"react-native": ["."]}
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"types": [],
"jsx": "react",
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"react-native": ["."],
"react-native/*": ["../*"]
}
}
}

0 comments on commit 20becd3

Please sign in to comment.