Mocking an npm package / module in Vitest can be a tricky thing. The mock function works in such a way that it can easily confuse you and get you stuck, especially when you want part of your test cases to use the mocked version of it, but the other part the original. In this video I'll show you how you can achieve that. -- 🤝 Become a friend of the channel! Start your membership today and get extra benefits: @nikolovlazar/join 💬 A bunch of us are hanging out at Join us! 🐦 Find me on the bird app: 🎥 What I use for coding and making videos: -- Chapters: 00:00 - Intro 00:39 - The problem 01:20 - The reason 01:53 - What you think might be the solution 03:11 - Solution #1 04:07 - Solution #2 09:21 - Recap











