-
Hey Team, I hope you are doing great. Thank you for this package; it makes creating new libraries very fast. As I want to add testing using the React Native Testing Library, I am having a difficult time getting it to work with my project setup. Could you please provide any guidance or ideas on how I can make it work? I installed the React Native Testing Library and added the following config: //jest.config.js
module.exports = {
preset: 'react-native',
setupFiles: ['./jest.setup.js'],
transformIgnorePatterns: [
'node_modules/(?!(react-native|@react-native|@react-native-community|@react-navigation)/)',
],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
}; // jest.setup.js
import '@testing-library/react-native/extend-expect'; but I am still having issue |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
This is unrelated to bob. There's nothing different about how to setup jest. You have an issue in your config. The setup should be done in |
Beta Was this translation helpful? Give feedback.
After a few hours of digging into the issue, it looks like using the React Native preset for testing fixed my problem.
Install @react-native/babel-preset
Set @react-native/babel-preset as default preset for tests
@satya164 i noticed an issue while trying to run
yarn run release
:The issue was related to commit lint, to fix it we need to update th…