모든 일에 의문을 제기하고 그 의문을 해결하기 위해 지식을 구하고 공부
테스트코드 작성기 본문
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
'테스팅 라이브러리' 카테고리의 다른 글
TDD | API 및 hook 테스트 (0) | 2021.12.24 |
---|