You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
beforeEach(()=>{jest.useFakeTimers();})afterEach(()=>{jest.runOnlyPendingTimers();jest.useRealTimers();});describe('',()=>{it('should wait for response',async()=>{renderWithProviders(<Component/>,baseState);userEvent.click(screen.getByTestId('item-1'));userEvent.type(screen.getByTestId('search'),'Apple juice');awaitwaitForElementToBeRemoved(screen.getByTestId('loader'));});
I have effector as state manager and It has debounce function in patronum helper library. Under the hood it uses setTimeout, that's why I'm using jest fake timers.
What happened:
I saw this issue #661 and @kentcdodds fixed issue with fake timers but my test doesn't wait for response finish. I don't know why. When I log response it show me in console (Cannot log after tests are done. Did you forget to wait for something async in your test?). So it handle response well but doesn't wait for it.
The text was updated successfully, but these errors were encountered:
@testing-library/react
version: 12.0.0Relevant code or config:
business logic
What you did:
I have effector as state manager and It has debounce function in patronum helper library. Under the hood it uses setTimeout, that's why I'm using jest fake timers.
What happened:
I saw this issue #661 and @kentcdodds fixed issue with fake timers but my test doesn't wait for response finish. I don't know why. When I log response it show me in console (Cannot log after tests are done. Did you forget to wait for something async in your test?). So it handle response well but doesn't wait for it.
The text was updated successfully, but these errors were encountered: