4 ms·
Hi, I admit that finding the right balance between elegant mocks and effective coding is difficult. If you want to mock objects, using rewire, means that you sh
by musikele 10y ago
Hi, I admit that finding the right balance between elegant mocks and effective coding is difficult. If you want to mock objects, using rewire, means that you should never use const for your internal modules.
On the other side, one might choose to apply some dependency injection and pass modules via the "constructor" (let me pass the term). That's not good too.
So, my default choice is to use const for modules and real constants, and let for the rest. This way I can elegantly test my code. For me, testing is more important than respecting rules chosen by others.