Closed
Description
react-hooks-testing-library
version: 0.4.0react-testing-library
version: 6.0.3react
version: 16.8.6node
version: 11.10.0npm
(oryarn
) version: 1.15.2
Relevant code or config:
import { useResource } from 'rest-hooks';
renderHook(() => {
article = useResource(CoolerArticleResource.singleRequest(), payload);
return article;
})
What you did:
Running unit tests on 'rest-hook's library. Trying to update from react-testing-library - which works fine - to react-hooks-testing-library.
(https://github.com/coinbase/rest-hooks/blob/master/src/react-integration/__tests__/integration.tsx)
What happened:
Invariant Violation: Rendered more hooks than during the previous render.
Reproduction:
https://github.com/coinbase/rest-hooks/blob/update-test/src/react-integration/__tests__/integration.tsx#L167
(run yarn test
on that branch)
Problem description:
Impossible to test hooks that use suspense. (This was fixed in React 16.8.2 facebook/react#14821)