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

Test fetchData from useClientRequest #31

Closed
jackdclark opened this issue Feb 19, 2019 · 0 comments · Fixed by #32
Closed

Test fetchData from useClientRequest #31

jackdclark opened this issue Feb 19, 2019 · 0 comments · Fixed by #32

Comments

@jackdclark
Copy link
Contributor

See

it.skip('needs testing', () => {
// fetchData updates the state & therefore needs to be wrapped inside an `act`
// https://reactjs.org/docs/test-utils.html#act.
//
// Warning: An update to TestHook inside a test was not wrapped in act(...).
// When testing, code that causes React state updates should be wrapped into act(...):
// act(() => {
// /* fire events that update state */
// });
// / * assert on the output */
// This ensures that you're testing the behavior the user would see in the browser. Learn more at https://fb.me/react-wrap-tests-with-act
// in TestHook
// in Wrapper
//
// fetchData is an async function, which `act` does not currently support
// see https://github.com/facebook/react/issues/14769
//
// support is currently being implemented
// see https://github.com/facebook/react/pull/14853

@jackdclark jackdclark changed the title Test fetchData Test fetchData from useClientRequest Feb 19, 2019
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 a pull request may close this issue.

1 participant