Skip to content

Add Vitest cleanup hint to react-testing-library setup docs #1422

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

Conversation

ezzatron
Copy link
Contributor

This PR adds a heading to the setup guide for react-testing-library that explains how to get auto-cleanup working when using Vitest. The wording was inspired by a similar heading in the vue-testing-library setup guide: https://testing-library.com/docs/vue-testing-library/setup/#vitest

Copy link

netlify bot commented Sep 12, 2024

Deploy Preview for testing-library ready!

Name Link
🔨 Latest commit 0043700
🔍 Latest deploy log https://app.netlify.com/sites/testing-library/deploys/66e3fa6080e8700008f9df24
😎 Deploy Preview https://deploy-preview-1422--testing-library.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should explain how to build auto-cleanup by yourself i.e. what do you do if you don't want to enable globals

@ezzatron ezzatron requested a review from eps1lon September 13, 2024 08:41
@ezzatron
Copy link
Contributor Author

I had a crack at documenting how to get it working without enabling globals. Let me know what you think.

@ezzatron
Copy link
Contributor Author

Just following up to ask if there's anything else needed to progress this PR?

Copy link
Member

@MatanBobi MatanBobi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@MatanBobi MatanBobi merged commit c1e7d22 into testing-library:main Dec 11, 2024
4 checks passed
@MatanBobi
Copy link
Member

@all-contributors please add @ezzatron for docs :)

Copy link
Contributor

@MatanBobi

I've put up a pull request to add @ezzatron! 🎉

@ezzatron ezzatron deleted the react-setup-vitest-auto-cleanup branch December 11, 2024 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants