Refactoring the tests
In this section, we’ll look at some of the refactoring work we can do before we start thinking about the next feature. We’ll start by fixing the test warnings from the last section, then we’ll add a third test as a completeness test, and we’ll finish by adding some styles.
Refactoring and changing behavior
The usual definition of refactoring is any internal change that does not affect external behavior. It is a bit of a stretch to include CSS style changes in this, or indeed changes that remove warnings. But I find that early on in a project, there are always little changes such as these ones that need to be made. The key point is that your test suite is green and remains green throughout.
Cleaning up warnings
It’s important to clean up any warnings as they appear. That’s because without doing this, the test runner output becomes full of noise. We want the output to be as short as possible so that it’...