4 ms·
Testing generally can be either a great or painful experience. The more mocking you have to do (or setup for your testing environment) the more painful it is.
by bern4444 4y ago
Testing generally can be either a great or painful experience. The more mocking you have to do (or setup for your testing environment) the more painful it is.
I try and avoid mocking, or mock as low as possible. Ideally mocking only happens at the HTTP level for network requests and APIs. Having to mock internal functions (that don't make network requests) creates a frustrating experience.
I also find using typescript a great way of writing little unit tests. Making sure types line up, especially when types are highly relational, is exceptionally valuable.