Reading through this link i got to know that the equivalent of
and.callFake
is mockImplementation
and
and.returnValue
is mockReturnValue
.
Similarly is there an equivalent of and.callThrough()
in jest-preset-angular?
This question may be really old, but tripped me up recently.
Jest, by default, will call the underlying function in a similar manner to .and.callThrough()
.
This is the opposite behaviour of Jasmine, which blocks the call to the underlying function unless .and.callThrough()
is specified.
To block the underlying call in Jest, call the mockImplementation()
function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With