codespaces-preact icon indicating copy to clipboard operation
codespaces-preact copied to clipboard

Use `mount` rendering in tests

Open robertknight opened this issue 3 years ago • 0 comments

Hello,

As a maintainer of the Enzyme adapter for Preact, I would strongly recommend that new code should using the mount ("full DOM rendering") rather than the shallow rendering mode as this template currently does. I wrote a blog post a while back which explains the rationale in detail and alternative ways to achieve the same results. In brief the main reasons are that shallow rendering tends to lead to brittle tests which are a pain to maintain, and the approach has fallen out of favor in the ecosystem, so there are less resources available related to it.

If I can find time to submit a PR I will do so, but otherwise I'd welcome someone else to make the change.

robertknight avatar Nov 17 '22 16:11 robertknight