I have a func A() in class Characters.
I want to mock function A so I did this:
const char = new Character();
jest.spyOn(char, 'A').mockImplementation(async ({}) => {
throw new Error('something');
})
When I try to run another function that uses A, for example getChars(). and I need to loop and run A a few times, I get to a point that I get to the ACTUAL original function A!
Why does this happen? why does this not use the mock function again? please help!
I tried changing the implementation but nothin worked.