testing-library / svelte-testing-library

:chipmunk: Simple and complete Svelte DOM testing utilities that encourage good testing practices
https://testing-library.com/docs/svelte-testing-library/intro
MIT License
620 stars 33 forks source link

fix(svelte5): use state rune for rerender #374

Closed mcous closed 6 months ago

mcous commented 6 months ago

This PR removes usage of the svelte/legacy by implementing rerender in Svelte 5 via the $state rune, as recommended in the migration docs.

It also adds a "runes mode" component fixture and parameterizes the render and rerender tests to test both "legacy" and "runes mode" components when running in Svelte 5

mcous commented 6 months ago

@yanick leaving the structural / strategy discussion aside, what do you think about the PR as is? I think the removal of the svelte/legacy import and the addition of a component fixture using runes puts us on the right track for the Svelte 5 proper release, so I'm keen to get this PR in

mcous commented 6 months ago

Going to incorporate this into #375 to avoid an intermediate release