Mocking scrollToIndex with jest
Since the Virtualizer is getting compiled to a function on the build output,
jest.spyOn(Virtualizer.prototype, 'scrollToIndex')
will not work
What would then be the best way to check that scrollToIndex
is called with the correct value within a test?1 Reply
harsh-harlequinOP•3y ago
Solution I have got right now:
Define this function
And call it inline within the code whenever I call
scrollToIndex