JEST 함수 호출 마다 들어오는 데이터 확인 하는 방법 [ toHaveBeenNthCalledWith ]
코드 중 for문 안에 들어있는 함수를 테스트 코드로 나타내야 할 때 사용 할 수 있다. jest의 toHaveBeenNthCalledWith 함수를 사용 하여 반복문이 돌며 test에 a0, a1, a2, a3 이 들어 갈 때 테스트코드를 사용하여 순서에 맞게 들어가는 값을 확인 할 수 있다 사용 방법 expect(tasksRepository.test).toHaveBeenNthCalledWith(1, 'a0'); expect(tasksRepository.test).toHaveBeenNthCalledWith(2, 'a1'); expect(tasksRepository.test).toHaveBeenNthCalledWith(3, 'a2'); expect(tasksRepository.test).toHaveBee..
2022.10.25