Summary
This chapter has shown you how to write an end-to-end test with Playwright and use that as a scaffold for your Vitest unit tests. The Playwright tests check that all the units are working together, and the framework is doing its job. The Vitest tests check that you are satisfying the contract required from SvelteKit, such as the load
function working in the correct fashion.
You’ve also seen how TDD can be used to delay design decisions that aren’t immediately relevant, like how we hardcoded sample data rather than implement any kind of persisted database of birthdays.
In the next chapter, we’ll expand on the same ideas by implementing a SvelteKit form action, enabling you to add new birthdays to the list.