To Mock or Not to Mock, That is The Question

Chak Shun Yu
4 min readMay 28, 2021

Mocking dependencies of your code is one of the fundamental aspects of software testing. It’s a powerful method that allows developers to gain control over a certain part of your code and create an isolated environment for your test if done too much. This will make your tests less reliable and create a false sense of security, which is exactly not what we want.

Chak Shun Yu

Lifelong learner working as a frontend engineer. React. Self Development and Reflection. Testing. Technical Blogging.