1
나는이 노력하고있어 : AP.require 문자열과 두 번째 인수로 수신 기능해야 조롱 기능입니다Jest를 사용하면 조롱 된 함수의 인수가 함수인지 어떻게 확인할 수 있습니까?
expect(AP.require).toBeCalledWith('messages',() => {})
.
테스트는 메시지와 함께 실패합니다
Expected mock function to have been called with:
[Function anonymous] as argument 2, but it was called with [Function anonymous]
앤서 스는 고맙다. 제 생각에는 첫 번째 줄은'const call = AP.require.mock.calls [0]'이어야한다고 생각합니다. –