-
Notifications
You must be signed in to change notification settings - Fork 231
Closed
Labels
enhancementNew feature or requestNew feature or requestneeds more inforequire more information before we can actionrequire more information before we can action
Description
react-hooks-testing-libraryversion: 5.0.3reactversion: 16.13.1react-domversion (if applicable): 16.13.1nodeversion: 14.13.1npm(oryarn) version: 1.22.4
Relevant code or config:
import {waitFor} from '@testing-library/react';
import {renderHook} from '@testing-library/react-hooks';
it('does a thing', async () => {
const {result} = renderHook(() => useTestHook());
await waitFor(() => expect(result.something).toBe(true));
});What you did:
Used the wrong version of waitFor
What happened:
The console gave a warning for using the wrong version of act.
Problem description:
While it is true that the wrong version of act is used, it is only used inside of the waitFor here. Which can make it difficult to see where the wrong version of act is coming from.
Suggested solution:
An ESLint rule to check and warn on usage of the wrong waitFor in the same test block?
It seems that the current warning comes from React/React-DOM. Would it be possible to add another warning here on in react-testing-library's waitFor to provide more information?
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestneeds more inforequire more information before we can actionrequire more information before we can action