Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

test: add onMount test and replace onDestory test #303

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

Merged
yanick merged 3 commits into testing-library:main from mcous:test-onmount
Jan 31, 2024
Merged

test: add onMount test and replace onDestory test #303

yanick merged 3 commits into testing-library:main from mcous:test-onmount
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

@yanick yanick merged commit ed30dc1 into testing-library:main Jan 31, 2024
@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

Reviewers

@yanick yanick yanick left review comments

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /