Skip to content
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

Why user-event,jest-dom are putting in small *ecosystem*? Those are de facto stuff within @testing-library/react as almost React devs. #515

Closed
ryota-murakami opened this issue Jul 1, 2020 · 3 comments

Comments

@ryota-murakami
Copy link

And more @kentcdodds always using jest-dom matcher on anywhere like https://kentcdodds.com/blog/react-is-an-implementation-detail
And user-event is covering area where doesn't work wellfireEvent, both API(Package) should be introduce same timing on document I think.
Following current event firing document page only introduce fireEvent API.
https://testing-library.com/docs/dom-testing-library/api-events

I love testing-library since just react-testing-library, so I'm glad to see more organized well that!
Thank you 🤗

@nickmccurdy
Copy link
Member

nickmccurdy commented Jul 2, 2020

Thanks for your feedback. We have reasons for keeping these things separate, though I think it's valid criticism that it can be confusing to figure out how to use them together, especially in the ways we recommend. We also plan on reorganizing the docs to make this all easier to learn.

If you're using React, I'd encourage you to use create-react-app, as the template includes these packages (and we plan on adding the linter packages). Either way I'd be interested in any other feedback or frustrations you've having with using these tools together that I haven't mentioned yet.

And more @kentcdodds always using jest-dom matcher on anywhere like https://kentcdodds.com/blog/react-is-an-implementation-detail

Jest DOM is one of the only libraries in this organization that actually requires Jest. It provides Jest matchers to expect, so it needs the Jest APIs to work. However it's also reusable enough to be useful without testing library, and testing library needs to work outside of Jest, so I personally think it should be separate. Still, it's integrated into the create-react-app template, and we may add other integrations if you need to use Jest and testing library without React (just let us know!).

And user-event is covering area where doesn't work wellfireEvent, both API(Package) should be introduce same timing on document I think.
Following current event firing document page only introduce fireEvent API.
https://testing-library.com/docs/dom-testing-library/api-events

We actually started to merge user-event into dom-testing-library (which would eventually be merged into all other testing libraries), but had issues with asynchronous event timing and decided to keep it separate for now. We could use some help figuring that out if you'd like to troubleshoot it.

Until they're merged, I don't think user-event's documentation should be on the dom-testing-library page because it's not in the same package (yet), and we don't want to confuse people that haven't installed it yet. However the documentation is kinda hard to find for a package we recommend. What would you think about us moving the documentation to the website on another page (rather than just keeping it in the readme here and having a basic example on the website)?

@ryota-murakami
Copy link
Author

testing library needs to work outside of Jest

That's completely where out side from my head, and now I agree with your current direction.

We also plan on reorganizing the docs to make this all easier to learn.

We actually started to merge user-event into dom-testing-library (which would eventually be merged into all other testing libraries), but had issues with asynchronous event timing and decided to keep it separate for now.

I didn't know these improvement works on going, I could have expectation Docs will getting better without my concern!

What would you think about us moving the documentation to the website on another page (rather than just keeping it in the readme here and having a basic example on the website)?

I think it's great idea because if visiter has a chance once to recognize @testing-library/user-event package, visitor will have information about @testing-library/user-event's background from the issue linked top of the head of README.

thank you for your qualified answer that's make sense at all.
Please feel free to close the issue anytime. 😀

@nickmccurdy
Copy link
Member

nickmccurdy commented Jul 3, 2020

Thanks again! I've opened #519 to discuss moving the user-event docs over. You can also subscribe to that issue if you'd like notifications.

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

No branches or pull requests

2 participants