I have a problem when I try to test render method in my ReactNative application with EXPO, I am using JEST and reactnative-testing-library.This is my code:
import { render, fireEvent, cleanup, wait } from '@testing-library/react-native';import { LoginScreen } from '../../App/screens/LoginScreen'; import '@testing-library/jest-native/extend-expect'; import { View } from "react-native"; const fakeNavigation = { navigation: {} as any } it("renders correctly", () => { const screen = render(<LoginScreen {...fakeNavigation}>{() => <View />}</LoginScreen>);});
Before writing this question I watched this linkReference error: `import` a file after the Jest environment has been torn downand also tried workaround
jest.useFakeTimers()
but nothing works.