Trying to perform npm test on my React Native application, unit testing with Jest are working fine. However with react-test-renderer it complaining the following issue.
FAIL __tests__/App-test.js
● Test suite failed to run
TypeError: (0 , _native.createNavigatorFactory) is not a function
at Object.<anonymous> (node_modules/@react-navigation/material-top- tabs/lib/commonjs/navigators/createMaterialTopTabNavigator.tsx:50:16)
at Object.<anonymous> (node_modules/@react-navigation/material-top-tabs/lib/commonjs/index.tsx:4:1)
I did not write this test case, it comes default while the project was created. I'm expecting to see a pass unit test from here, what seems to be the issue from the react-test-renderer?
/**
* @format
*/
import 'react-native';
import React from 'react';
import App from '../App';
// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';
it('renders correctly', () => {
renderer.create(<App />);
});