DEV Community

Alejandro Gelos
Alejandro Gelos

Posted on

Stop Mocking the Code You Should Be Testing

Some tests feel like writing the answer on the back of a card, flipping it over, and celebrating because it says exactly what you expected.

Sure, the test passes.

But when it’s time to release, does that test actually give you confidence?

Stop mocking the code you should be testing.

Real ViewModel. Real dependencies. Real mapping.

Mock only the external boundary.

Full article:

https://medium.com/@alejandrogelos/stop-mocking-the-code-you-should-be-testing-9b2b2533742d

Are you writing tests just to decorate your coverage, or tests that actually add value?

Top comments (0)