-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
@testing-library/svelte includes logic to render Svelte components into the DOM. It's mostly a thin wrapper around the svelte module itself, but it's got a few tricks up its sleeves:
- Component mounting and cleanup
- Wrapper DOM element creation, insertion, and cleanup
- Compatibility layers for Svelte 3, 4, and 5, including TypeScript types
- An extensive test suite across Svelte 3/4/5, jest/vitest, happy-dom/jsdom
All this logic is already separate from the "final" step of this library - binding @testing-library/dom queries to the rendered component. If it were to be published as its own library (@testing-library/svelte-core) without @testing-library/dom it could be used in other Svelte-testing contexts that bring their own query systems and don't need DOM Testing Library
- https://github.com/vitest-community/vitest-browser-svelte
- https://github.com/threlte/test-renderer
- Maybe other places?
See vitest-community/vitest-browser-svelte#3 for more details
Metadata
Metadata
Assignees
Labels
No labels