Skip to content

feat(qwik-testing-library): add documentation for Qwik Testing Library #1432

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
merged 5 commits into from
Oct 30, 2024

Conversation

ianlet
Copy link
Contributor

@ianlet ianlet commented Oct 5, 2024

This PR adds documentation for the new Qwik Testing Library to provide more testing tools for the Qwik Framework.

The library was tested with a few projects running in production, but any additional feedback is greatly appreciated as well!

We will keep updating the documentation with more examples and upcoming APIs (such as better mocking utilities and renderHook) when they become available.

Note: the easy way to setup the library with npm run qwik add testing-library is a PR in the Qwik framework and will soon be available. You need to follow the manual setup for now.

Copy link

netlify bot commented Oct 5, 2024

Deploy Preview for testing-library ready!

Name Link
🔨 Latest commit 98b3fab
🔍 Latest deploy log https://app.netlify.com/sites/testing-library/deploys/6722696089e2ba00088f9c66
😎 Deploy Preview https://deploy-preview-1432--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

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

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

I'm not really up-to-date with this PR.

Did you verify bringing the documentation over to testing-library.com with someone @ianlet ?
I'm asking because the other libraries are all part of the @testing-library org (with SolidJS as an exception).

@ianlet
Copy link
Contributor Author

ianlet commented Oct 13, 2024

Thanks for the follow-up @timdeschryver! No, I did not verify bringing the documentation over to tesing-library.com before with someone as I was thinking this PR would open up the conversation. Sorry if I should have contacted someone before 😶

How do you usually proceed to bring in a new port of Testing Library to another framework?

@timdeschryver
Copy link
Member

Sorry for my late response @ianlet
We've discussed this and are currently in the process of reviewing the library/docs

cc @MatanBobi

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 for this Ian.
I've left a few comments :)

Also, regarding the library itself, I recommend adding qwik (with the supported version) and DTL as peer dependencies.
I'd also think about automatic cleanup but that might be tricky to support in both vitest and jest.

@ianlet
Copy link
Contributor Author

ianlet commented Oct 26, 2024

I'd also think about automatic cleanup but that might be tricky to support in both vitest and jest.

@MatanBobi Would you consider this as a blocker for this PR? In any case I think we can reuse the same approach as RTL where they check if globals are set and use that to autocleanup (+ an env var to opt out). It should work for both vitest and jest as they use the same global API.

@MatanBobi
Copy link
Member

@MatanBobi Would you consider this as a blocker for this PR? In any case I think we can reuse the same approach as RTL where they check if globals are set and use that to autocleanup (+ an env var to opt out). It should work for both vitest and jest as they use the same global API.

Definitely not a blocker :)

Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

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

I think everything is covered 👍

@ianlet
Copy link
Contributor Author

ianlet commented Oct 27, 2024

@MatanBobi @timdeschryver updated the PR with your comments

I also made a new release in the library itself to add support for auto cleanup and the ability to opt out with QTL_SKIP_AUTO_CLEANUP like the other libraries offer.

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.

This looks great to me, thanks Ian :) I'll leave it open for a couple of days to see if @timdeschryver wants to approve it too.

@timdeschryver
Copy link
Member

I will go over this tomorrow.
Thanks for your patience @ianlet , and your thorough review @MatanBobi

Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

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

LGTM 👍
I just encountered a small typo, which I committed and resolved myself.

@timdeschryver timdeschryver merged commit fb67c65 into testing-library:main Oct 30, 2024
4 checks passed
@timdeschryver
Copy link
Member

@all-contributors please add @ianlet for docs

Copy link
Contributor

@timdeschryver

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

@ianlet
Copy link
Contributor Author

ianlet commented Oct 31, 2024

Thank you @timdeschryver & @MatanBobi for your reviews and for merging! 🙌

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