12 Testing
This chapter covers
- Unit tests with Jest
- End-to-end tests with Cypress
- Accessibility tests with the Svelte compiler, Lighthouse, axe, and WAVE
- Demonstrating and debugging Svelte components with Storybook
Now that we’ve covered most of the features of Svelte, it’s time to turn our focus to testing. We want to feel confident that our applications have properly implemented their intended functionality in a way that is accessible to a variety of users and that will remain that way through repeated updates. Three primary kinds of tests to consider are unit, end-to-end, and accessibility.
Unit tests are intended to test a piece of code in isolation from the rest of an application. These are great for testing individual functions and ...
Get Svelte and Sapper in Action now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.