React-hooks-testing-library: Merge with testHook - move package here?

Created on 16 Feb 2019  路  5Comments  路  Source: testing-library/react-hooks-testing-library

Hi,
Some folks that worked on hook test utils in react-testing-library (@kentcdodds, @donavan) are thinking about extracting testhook into its own package. The API is pretty similar to what you have here - would you consider reviewing the current state of that API and merging it with react-hooks-testing-library?

Discussion: https://github.com/kentcdodds/react-testing-library/issues/302

WIP Docs for testHook: https://github.com/alexkrolick/testing-library-docs/pull/32

Next steps:

  • [x] Review and port the API if it is an improvement
  • [ ] Add a docs page in the "ecosystem" section of the docs repo
  • [ ] Port examples in the docs PR to extracted library

Most helpful comment

I'll leave this open for the time being.

The testHook code has been released as v0.3.0 on NPM

All 5 comments

Hey,

I was just reading on twitter about testHook in react-testing-library and went to have a look when I saw the notification for this issue, lol.

This library was more of a proof of concept than anything for me when the hooks alpha was released and I only updated it recently to match the 16.8 changes. When I was checking out testHook's source, I thought that it was very similar to what I had here, and also thought it didn't make sense for both to compete with each other.

I've had a few ideas recently about some changes I want to make to the API, but haven't really locked it down in my head yet. What is here now is a little bit muddled, both in terminology and implementation.

I'd almost be comfortable scrapping what is here currently and starting with testHook as the base and build on from there (I imagine there are more people that would need an easier migration from react-testing-library than the few that would be using my library).

I'll take a closer look at testHook tonight and see what I think more on this after that.

Perhaps I'll do up a table of feature comparisons and we can discuss preferred approaches.

@alexkrolick looks good so far, check out the PR and let me know what you think.

I'll leave this open for the time being.

The testHook code has been released as v0.3.0 on NPM

I'm going to close this in preference of #15.

As for the examples, I'm not sure the API is complex enough to worry with example over and above the README and the test suite, but I'm happy to review any PRs if people want to add them.

Was this page helpful?
0 / 5 - 0 ratings