ts-mockito
ts-mockito copied to clipboard
Johanblumenberg fnmock
trafficstars
@cspotcode I want to merge this PR, wdyt?
@johanblumenberg on another topic :) I really liked that implementation, do you think it's enough to be ported or are there any other functionalities in scope of mocking single fns you've added worth grabbing?
@LironHazan go for it. I won't have much time for ts-mockito so I probably won't be able to do code review, so I say go for it with whatever you have planned.
I think that this can be easily achieved with spies, instead of creating a new interface:
const CallbackSpy = spy({ callback: () => 'foobar' });
expect(CallbackSpy.callback()).toHaveBeenCalled()