© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2023
A. LibbyDeveloping Web Components with Svelte https://doi.org/10.1007/978-1-4842-9039-2_9

9. Testing Components

Alex Libby1  
(1)
Belper, Derbyshire, UK
 

So far, we’ve spent time creating our masterpiece, ready for use, but – can we be sure it all works? What guarantee do we have that it won’t suddenly collapse in a heap the first time someone tries to use it?

Before we release our library to the outside world, we need to test each component to ensure they all work as expected. In this chapter, we will go through the process of setting up unit testing for our library before exploring some examples of tests we can write, so end users can see how each component ...

Get Developing Web Components with Svelte: Building a Library of Reusable UI Components 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.