While some of the information here is helpful, I'd like to address the root of the asker's specific question.
It fails with
TypeError: _dayjs.default.extend is not a function
Unfortunately similar questions on here didn't help me. How could I mock both default dayjs but also extend?
The default export of dayjs is a function with properties attached. Your mock needs to follow the same pattern. The following pseudo-code is written to be library agnostic:
const dayjsMock = () => ({
add: () => {...}
});
dayjsMock.extend = () => {};
You'll plug this dayjsMock
object into your specific mocking library's function.