Testing dayjs with jest answer to StackOverflow question How to mock dayjs chained methods Result yarn run v1.22.4 $ jest PASS src/today.spec.js today ✓ should be called with a date (3 ms) ✓ should return consistent date (2 ms)