Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add onMount test and replace onDestory test #303

Merged
merged 3 commits into from
Jan 31, 2024

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

@mcous mcous force-pushed the test-onmount branch 2 times, most recently from 605d9eb to 1c91caf Compare January 30, 2024 11:52
vite.config.js Show resolved Hide resolved
@yanick yanick merged commit ed30dc1 into testing-library:main Jan 31, 2024
8 checks passed
@mcous mcous deleted the test-onmount branch January 31, 2024 21:14
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.

None yet

2 participants