Svelte · Middle · Question 29 of 75
How are Svelte components usually unit-tested?
- ✓Correct answer: With Vitest and
@testing-library/svelte: render the component, interact via user events, check the DOM - 2Only with Playwright E2E tests
- 3By calling component functions directly
Explanation
Logic with runes in .svelte.js files can be tested in .svelte.test.js files, where runes are compiled.