3
Loading Data into a Route
SvelteKit is very much about routing: figuring out what to display once your browser requests a page at a specific location. For example, the /birthdays route that we’ll work on in this chapter. Part of that routing is ensuring that the route has the data available to it. In this chapter, you’ll see how you can test-drive SvelteKit’s load function for pulling that data into a component.
You’ll also see how Playwright can be used to build an end-to-end test that proves all the various components of this system.
This chapter covers the following:
- Using Playwright to specify end-to-end behavior
- Deciding an approach to make the end-to-end test pass
- Test-driving the load function
- Test-driving the page component
By the ...
Get Svelte with Test-Driven Development 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.