Open akinzalowevidation opened 2 years ago
Hey @akinzalowevidation, Thanks for reporting the issue. We'll fix it.
Same over here!
any news on this ?
@ankit-tailor Any news on this fix?
Any updates for this Issue ?
@daniel-moya I discovered that this issue was happening due to improper mocking of react-native-safe-area-context
.
Adding the following to mocks fixed the issue for me:
import mockSafeAreaContext from "react-native-safe-area-context/jest/mock";
jest.mock("react-native-safe-area-context", () => mockSafeAreaContext);
@daniel-moya I discovered that this issue was happening due to improper mocking of
react-native-safe-area-context
.Adding the following to mocks fixed the issue for me:
import mockSafeAreaContext from "react-native-safe-area-context/jest/mock"; jest.mock("react-native-safe-area-context", () => mockSafeAreaContext);
This worked for me! Thanks @akinzalowevidation
Description
Jest tests with @testing-library/react-native are failing with an error
CodeSandbox/Snack link
N/A
Steps to reproduce
I am getting the following error when attempting to render a component in a jest test:
Here is how I have setup the test:
Component.test.tsx
package.json
jest.config.js
NativeBase Version
3.4.4
Platform
Other Platform
No response
Additional Information
I have tried upgrading,
@testing-library/react-native
,jest
and usingts-jest
and that did not solve the issue.