Skip to content

pkg: react-hooks-testing-library major #497

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

Merged
merged 7 commits into from
Jan 31, 2021
Merged

pkg: react-hooks-testing-library major #497

merged 7 commits into from
Jan 31, 2021

Conversation

ntucker
Copy link
Collaborator

@ntucker ntucker commented Jan 24, 2021

BREAKING CHANGE:

  • result.current, result.error is now undefined after suspense, rather than null
  • interval will now default to 50ms in async utils
  • timeout will now default to 1000ms in async utils
  • suppressErrors has been removed from async utils
  • Adjust types so that react renderer exports don't required extra generic parameter
  • Importing from renderHook and act from @testing-library/react-hooks will now auto-detect which renderer to used based on the project's dependencies

Motivation

Keep up with the latest

Solution

Upgrade react-hooks-testing-library from 3.2 to 5
Had to change all the checks for suspense to undefined from null.
Deprecated cleanup() as it already happens on unmount.
Added cleanup() to externalprovider in tests to reflect behavior of cacheprovider.
Updated redux docs to include calling manager's init

Waiting on testing-library/react-hooks-testing-library#554 to be able to use this version.

@ntucker
Copy link
Collaborator Author

ntucker commented Jan 24, 2021

Might have to consider forking or discontinuing use of this library as it doesn't seem to be maintained well.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 24, 2021

Size Change: +230 B (0%)

Total Size: 109 kB

Filename Size Change
packages/test/dist/index.cjs.js 3 kB +230 B (7%) 🔍
ℹ️ View Unchanged
Filename Size Change
packages/core/dist/index.cjs.js 12.5 kB 0 B
packages/core/dist/index.umd.min.js 5.73 kB 0 B
packages/endpoint/dist/index.cjs.js 1.76 kB 0 B
packages/endpoint/dist/index.umd.min.js 1.29 kB 0 B
packages/hooks/dist/index.cjs.js 714 B 0 B
packages/hooks/dist/index.umd.min.js 429 B 0 B
packages/legacy/dist/index.cjs.js 579 B 0 B
packages/legacy/dist/index.umd.min.js 511 B 0 B
packages/normalizr/dist/normalizr.amd.js 10.3 kB 0 B
packages/normalizr/dist/normalizr.amd.min.js 5.59 kB 0 B
packages/normalizr/dist/normalizr.browser.js 10.3 kB 0 B
packages/normalizr/dist/normalizr.browser.min.js 5.59 kB 0 B
packages/normalizr/dist/normalizr.js 10.1 kB 0 B
packages/normalizr/dist/normalizr.min.js 5.59 kB 0 B
packages/normalizr/dist/normalizr.umd.js 10.4 kB 0 B
packages/normalizr/dist/normalizr.umd.min.js 5.67 kB 0 B
packages/rest-hooks/dist/index.cjs.js 7.67 kB 0 B
packages/rest-hooks/dist/index.umd.min.js 4.08 kB 0 B
packages/rest/dist/index.cjs.js 3.88 kB 0 B
packages/rest/dist/index.umd.min.js 2.14 kB 0 B
packages/use-enhanced-reducer/dist/index.cjs.js 1.08 kB 0 B
packages/use-enhanced-reducer/dist/index.umd.min.js 607 B 0 B

compressed-size-action

@ntucker ntucker marked this pull request as draft January 24, 2021 04:17
@ntucker ntucker changed the title Pkg/testing hooks pkg: react-hooks-testing-library major Jan 24, 2021
@ntucker ntucker force-pushed the pkg/testing-hooks branch 9 times, most recently from dccd9f8 to a863bbf Compare January 25, 2021 21:40
@ntucker ntucker requested a review from ljharb January 31, 2021 15:49
@ntucker ntucker marked this pull request as ready for review January 31, 2021 15:49
@@ -46,7 +46,7 @@
"url": "https://github.com/coinbase/rest-hooks/issues"
},
"dependencies": {
"@testing-library/react-hooks": "~3.5.0"
"@testing-library/react-hooks": "~5.0.3"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why ~ ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As outlined in a previous PR - there was an uncaught breaking change in a minor upgrade to this library. This lets us validate all minor upgrades before our users potentially get broken things.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oof, gross

@ntucker ntucker merged commit e6a5210 into master Jan 31, 2021
@ntucker ntucker deleted the pkg/testing-hooks branch January 31, 2021 15:59
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

Successfully merging this pull request may close these issues.

2 participants