Skip to content
Advertisement

Tag: dayjs

Mocking dayjs extend

In my code that needs testing I use In my test I need to mock dayjs in order to always have the same date when comparing snapshots in jest so I did It fails with Unfortunately similar questions on here didn’t help me. How could I mock both default dayjs but also extend? Answer You could write a more thorough

Advertisement