All Questions
Tagged with react-native-testing-library react-navigation
7 questions
3
votes
1
answer
1k
views
mockConstructor(...): Nothing was returned from render while testing Tab Navigator
I am trying to test my bottomTabNavigator and have followed the instructions here : https://callstack.github.io/react-native-testing-library/docs/react-navigation but I am getting this error
...
1
vote
0
answers
2k
views
I can't render @react-navigation's NavigationContainer in tests using react native testing library
When I try to test my entire application, I'm receiving this error (full log at the end):
Screen(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render ...
2
votes
1
answer
967
views
Type Safety for Testing React Navigation with React Native
NAVIGATOR
export type RootStackNavigator = {
Welcome: undefined
List: undefined
}
const Stack = createStackNavigator<RootStackNavigator>()
const { Navigator, Screen } = Stack
const ...
2
votes
1
answer
2k
views
Testing react-native-testing-library with react-navigation v5
I'm looking to test react-navigation v5 with react-native-testing-library. The documentation says to do the following.
import React from 'react';
import { NavigationContainer } from '@react-navigation/...
3
votes
0
answers
912
views
How to mock react-navigation properly with jest?
I get the following during npm test:
console.warn node_modules/react-navigation/src/react-navigation.js:23
`createNavigationContainer()` has been deprecated, please use `createAppContainer()` ...
2
votes
1
answer
7k
views
Jest + react-navigation not locating route / params
I am trying to write a test for an app using react-navigation and I am running into issues of the route and params being read correctly.
I am getting an error of
TypeError: Cannot read property '...
1
vote
0
answers
670
views
Error taking snapshot after using material-top-tabs because of react-native-reanimated mock
Current Behavior
After using @react-navigation/material-top-tabs my snapshot fails given the following error
TypeError: Cannot read property 'name' of undefined
at Object.onIndexChange (/Users/...