Summary
This chapter has covered how to test-drive SvelteKit forms and form actions using both Playwright end-to-end tests and Vitest unit tests.
You have seen how Vitest is useful for testing all the peculiarities of individual Svelte components but isn’t good at testing the framework code of SvelteKit, such as the code that takes an HTML form submit event, builds a server request, and invokes your form action. For that, you need a Playwright test.
In the next chapter, you’ll build on this form by adding some server-side form validations.