testing-library-docs icon indicating copy to clipboard operation
testing-library-docs copied to clipboard

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

Open ianlet opened this issue 1 year ago • 2 comments

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.

ianlet avatar Oct 05 '24 18:10 ianlet

Deploy Preview for testing-library ready!

Name Link
Latest commit 98b3fab7e78e0b42003e746d49157217be12ef4a
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.

netlify[bot] avatar Oct 05 '24 18:10 netlify[bot]

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?

ianlet avatar Oct 13 '24 02:10 ianlet

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

cc @MatanBobi

timdeschryver avatar Oct 25 '24 18:10 timdeschryver

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.

ianlet avatar Oct 26 '24 13:10 ianlet

@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 :)

MatanBobi avatar Oct 26 '24 14:10 MatanBobi

@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.

ianlet avatar Oct 27 '24 16:10 ianlet

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

timdeschryver avatar Oct 29 '24 19:10 timdeschryver

@all-contributors please add @ianlet for docs

timdeschryver avatar Oct 30 '24 17:10 timdeschryver

@timdeschryver

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

allcontributors[bot] avatar Oct 30 '24 17:10 allcontributors[bot]

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

ianlet avatar Oct 31 '24 00:10 ianlet