꼭 animate가 아니더라도 Dom element가 가지는 메소드를 사용할 때 기능은 멀쩡히 동작하는데 테스트 코드에서는 해당 메소드가 undefined로 나오는 오류가 발생할 수 있다. 이는 @testing-library/jest-dom에 해당 메소드가 구현되지 않았기 때문이다. 따라서 해당 메소드를 다음과 같이 명시적으로 추가해줘야 한다. (관련 링크)
'프론트엔드 기본개념 복습 > 테스트코드' 카테고리의 다른 글
[Jest] 비동기 코드 테스트하기 (Jest testing with Asynchronous codes) (0) | 2022.04.14 |
---|---|
[Jest] jest.spyOn() +window 객체 메소드 모킹하기 (0) | 2022.04.14 |
[Jest] ReferenceError:`jest.mock()` is not allowed to reference any out-of-scope variables. (0) | 2022.04.13 |
[Jest] jest.fn( )과 유닛 테스트 모킹 (Mocking in Unit Test) (0) | 2022.04.13 |