Is there a way to effectively mock the functionality of moment.js
for integration testing purposes? I've attempted to mock it using jest
following a guide like this one:
import moment from 'moment'
...
jest.mock('moment', () => () => ({valueOf: () => 100})
However, when running my test, the original moment
code is still being used.
I did manage to override moment
behavior by utilizing an approach mentioned here. Unfortunately, this method seems to override more functions than necessary, which is not ideal.