1st May, 2019
1 min read
Unit testing is an essential part of the success of any project. Integration tests are also essential and can range from so-called, coarse-grained, unit tests, through to full end-to-end test that use all parts of the system including backend services, databases etc.
The use of mocks is a contentious issue - some use them widely to create truly isolated unit tests, others only ever use real objects and dependencies, creating coarser-grained tests that they claim more closely represents the way the code is actually used.
Jest is fast becoming the most common and popular test framework, but others are still widely used - Ava, for one. The use of dependency injection, design patterns and code styles all effect the style of tests and also the code under test.
I have some opinions on many of these topics and I'll be using this series of posts to clarify my thoughts and explore different approaches to testing, and code design.
March 4th 2019 - 5 min read
As a group, developers are a funny lot. We have a rosy view of ourselves. We like to think we are proud of our craft. We tell ourselves that we study best practices, write tests, seek reviews from our…