10

这是我的根组件:

const App = () => (
    <Provider store={store}>
        <PersistGate persistor={persistor} loading={<LoadingView />}>
            <MainTabNavigator />
        </PersistGate>
    </Provider>
)
export default App

还有一个非常简单的快照测试:

describe('Testing root App component', () => {
    test('Renders as expected', () => {
        const tree = renderer.create(<App />).toJSON()
        expect(tree).toMatchSnapshot()
    })
})

当我运行测试时,它通过了,但我在它下面收到以下错误消息:

PASS  __tests__/App.test.tsx
  ● Console

    console.error node_modules/react-test-renderer/cjs/react-test-renderer.development.js:5190
      The above error occurred in the <TabView> component:
          in TabView (created by withCachedChildNavigation(TabView))
          in withCachedChildNavigation(TabView)
          in Unknown (created by Navigator)
          in Navigator (created by NavigationContainer)
          in NavigationContainer (created by App)
          in PersistGate (created by App)
          in Provider (created by App)
          in App

      Consider adding an error boundary to your tree to customize error handling behavior.
      Visit (url) to learn more about error boundaries.

因为测试通过了,这还重要吗?这是怎么回事?

4

0 回答 0