It’s possible to pass props to render if the component you’re testing needs them.
const { container } = render(Layout, {
props: {
data,
},
});
In this case I’m passing load function data to my layout route.
It’s possible to test a load function to Vitest in case you want to have an integration test for your server/data.
Simply import
load
(named) from the file and then do const data = await load({ fetch })
and you’ll be able to test the data.