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
615 stars 33 forks source link

fix: remove DOM elements even if component creation fails #314

Closed mcous closed 7 months ago

mcous commented 8 months ago

Overview

This PR fixes #190 by simplifying the caching strategy and ensuring the target div is added to the cache as soon as it's created, rather than after the component is rendered.

While working on this PR, I noticed a few inconsistencies with the render function's API, so I filed #312 and #313

Will keep this as a draft until I've smoke tested on my current app's suite

Change log

mcous commented 7 months ago

Smoke tested by running on my company's ~1000 test suite, everything seemed to behave. Marking this one as ready for review, accordingly!

mcous commented 7 months ago

The changes in this PR have been merged into next. Gonna close this PR as unnecessary!