테스팅 라이브러리
테스트코드 작성기
GROWNFRESH
2021. 12. 13. 18:48
useNavigation 테스트코드 작성하는 법
How to mock useNavigation hook in react-navigation 5.0 for jest test?
i want to mock useNavigation hook used inside my functional component. Any workaround how to mock it using jest? import React from 'react'; import { useNavigation } from '@react-navigation/native';
stackoverflow.com
https://spin.atomicobject.com/2021/02/24/react-navigation-5-unit-testing-components/
Unit Testing Components in React Navigation 5
Testing components that use the "useNavigation" hook can be complicated. Here are a few options to make testing these components easier.
spin.atomicobject.com