Summary
This chapter has involved writing many more unit tests than previous chapters. Sometimes, unit tests need to be very detailed, particularly when it comes to testing very specific return values. In Chapter 8, Creating Matchers to Simplify Tests, we’ll look at ways of reducing the number of tests required.
You’ve also seen why it’s important for unit tests to run independently and how to ensure your SvelteKit route tests clear their data between each test using the beforeEach
function.
In the next chapter, you’ll learn how to extend the current BirthdayForm
component to handle editing existing birthdays in addition to adding new birthdays.