on-internet
← Community

Using Jest expected mock function to have been called one time, but it was called zero times

Stack Overflow ·

I am new to the Jest testing framework and so I wan't too mock a function that returns a Promise to test my click event button. I am receiving an error that says my method has not been called but I have it defined below as a jest.fn() and expect it to be called once. Any help in solving this or some clarity on why my code is wrong. const props = { activitiesStore: { isFirst:false, isLast:false, isLaunching:false, isLoaded:false, currentActivityIndex:115, markLessonFinished:() => { }, setContent:{ description: "In the CompTIA A+ training course, you will learn the fundamentals of computer techn

Comments

Sign in or sign up to comment and upvote.

No comments yet.