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

docs: reintroduce import/require usage for user-event

Open nickserv opened this issue 3 years ago • 2 comments

It seems like when the docs for user-event 14 were released, the docs on import/require usage were removed. However, this reintroduces issues like https://github.com/testing-library/user-event/issues/485 if you don't already know how to destructure the default export from the CJS module. I fixed this by copying my docs from user-event 13 (https://github.com/testing-library/user-event/pull/495).

nickserv avatar Aug 22 '22 05:08 nickserv

Deploy Preview for testing-library ready!

Name Link
Latest commit a45ced8caf8805404e9bf0950f6d8754699dcb3a
Latest deploy log https://app.netlify.com/sites/testing-library/deploys/630312f60e8cae0008ef16c7
Deploy Preview https://deploy-preview-1143--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 settings.

netlify[bot] avatar Aug 22 '22 05:08 netlify[bot]

I know, but without this there isn't any mention on how to safely use user-event with CJS, and since this issue doesn't apply to other Testing Library packages, I don't think it would be obvious.

If you have any suggestions on how to simplify this while still safely importing user-event, I'm open to it. Otherwise, I think it would be a good idea to merge.

nickserv avatar Aug 22 '22 06:08 nickserv