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
608 stars 34 forks source link

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

Closed mcous closed 1 month ago

mcous commented 1 month 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 1 month 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 1 month ago

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