react-hooks-testing-library
react-hooks-testing-library copied to clipboard
Add docs to testing-library-docs
There is an existing PR created to add docs to testing-library-docs from when testHook was part of react-testing-library. Since it was removed and the code merged with this library, the PR has stalled waiting on updates to change it to reference this library instead.
If anyone wants to take over the PR and update it accordingly, you are more than welcome. You can even add yourself as a contributor here for your effort too.
See the PR for more details.
Disclaimer: I am not affiliated with the testing-library-docs repo or the PR in question, but I was asked to take it over and just find myself a bit time poor to actually do so at the moment.
@mpeyper could you point me out exactly what needs to be done? I might be interested to do it.
Hey guys, thanks for your lib, it looks promising. But it will be interesting if you can provide more examples in the doc. Especially on the rerender part, which is not very clear for me at this point.
@ab18556 It was suggested that it would be useful to add some documentation in the ecosystem section of https://testing-library.com/docs/intro.
Some work was previously done when the API was part of react-testing-library, but it would need to be updated to reference react-hooks-testing-library instead of react-testing-library and moved into the other section now.
The API is also slightly different now to when the PR was created the main differences from the top of my head:
testHook->renderHookinitialPropsandrerender(newProps)waitForNextUpdate()
It probably doesn't need to be too over the top with information, just the basics and a link back to our own docs (which also need to be improved).
Ok I will give it a try tomorrow night
Great! I've also raised #19 now which is also around docs (but our own) if your keen for that as well?
Sorry, I won't be able to update the doc. I am short on time and since english is my secondary language, I don't think I would be the best person to do it.
About the current issue, I made this PR https://github.com/alexkrolick/testing-library-docs/pull/64
It is based on the current doc's example. It might have to be updated once the doc is updated.
Thanks for the PR @ab18556, it's a good start. I think at least establishing an ecosystem page like this one would be enough to merge: https://github.com/alexkrolick/testing-library-docs/blob/master/docs/ecosystem-user-event.md
@alexkrolick this is basically what I put into the example page. Maybe it shouldn't be in the example section?
Ok, moving it all into the ecosystem page sounds good, too.
@mpeyper Any thoughts?
Sorry @ab18556 for not giving my thoughts (this one went under my radar).
I'm going to close this as since #40, we are no longer using react-testing-library for our rendering, so I'm no sure it's appropriate for us to be included in their docs anymore, unless there was some disclaimer added about this.
It definitely fits in the ecosystem section, other things like native-testing-library or jest-dom don't depend on any core libs either
I did not realise there was already precedence for this, so I'm happy to reopen this.
@mpeyper What all needs done to finish this issue? I got some time on my hands and would love to wrap this issue up if possible.
@LeviButcher there was (still is) as desire to get some representation in the official Testing Library docs. The original efforts by @ab18556 were made where we were using react-testing-library for rendering and fit more neatly into the regular mix of libraries. There were some suggestions that it could still make sense in the Ecosystem section, but I'm not sure what the stance is on that these days (i.e. is the use of dom-testing-library a prerequisite for getting in the main docs).
From my perspective, I feel like many of the testing libraries get to lean on the dom-testing-library docs for a lot of things (e.g. queries, async utils, etc.), whereas our implementation is a bit different so I would like to still maintain our own docs and have the a fairly basic example in the Testing Library docs and a link to our docs. Part of me feels like that's a duplication of effort though, so maybe we're best to look at moving what we have to the shared docs 🤷♂️
I'm open to suggestions on how best to do it.
@LeviButcher I am available to work with you on this as well, If thats fine.
@theresasogunle Absolutely!
I definitely agree with adding it to the ecosystem section in the Testing Library docs and based on past pull requests that seems to be what everyone agreed to.
I think we should copy the first examples on this page of the react hooks docs and put it in a hook testing library ecosystem page with a link back to the react hooks testing library docs.
I think this is a perfect first time contributor pull request and I noticed you haven't contributed to this one yet. So I was wondering if you would like to take the lead on contributing this to the testing-library-docs.