Migrating tests with a test todo list
The task at hand is moving the validation logic out of the SvelteKit form action we completed in Chapter 5, Validating Form Data, and into the birthdayRepository
module. And in this section, we’ll plan that task using a new technique.
You might remember that the birthdayRepository
module already exists but has no tests. That’s a situation that we often find ourselves in when we extract modules during refactoring. And it’s often perfectly okay to leave these modules untested. The issue comes when we want to modify the behavior of these modules: where do we add the tests?
There’s no clear answer to that, but in this case, we’ll use the opportunity to duplicate all the tests from the form action in the birthdayRepository
module, in addition to adding some new tests too.
Deleting tests in the original location
We won’t delete the original tests, but that is something you should consider doing so...