score:6

this error is thrown when the method you are trying to mock is not defined.

this will generate the same error:

const myobject = {}
jest.spyon(myobject, 'nonexistent')

so your problem is likely in the definition of cardresult, since cartresult.prototype.expandanswers is undefined.


Related Query

More Query from same tag