Skip to main content

All 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 ...
Thor0o0's user avatar
  • 407
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 ...
Luiz Rodrigues's user avatar
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 ...
User's user avatar
  • 149
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/...
Before The Empire's user avatar
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()` ...
Gregory01's user avatar
  • 107
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 '...
Blink Rankin's user avatar
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/...
Snowflake's user avatar
  • 301