Skip to content

Conversation

@mcous
Copy link
Collaborator

@mcous mcous commented Jan 29, 2024

Overview

This PR adds an onMount test and simplifies the onDestroy test. Supersedes #254

Change log

  • Add Mounter.svelte fixture with function prop hookups to onMount and onDestroy, letting us test via spies rather than the misdirection of rendering
  • Removed Stopwatch.svelte since it was a little confusing and didn't directly help the tests (see above point about misdirection)
  • Removed old unmount tests because they:
    • Exercised more code than was necessary to test mount/unmount
    • Inappropriately modified the global console object without cleanup
    • Seemed to be testing implementation details (console.warn) that no longer exist

@yanick yanick merged commit ed30dc1 into testing-library:main Jan 31, 2024
@mcous mcous deleted the test-onmount branch January 31, 2024 21:14
@github-actions
Copy link

🎉 This PR is included in version 4.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants