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
Hi, I'm testing an app which sends few requests and shows loaders when waiting for the response. The problem is that react-testing-library checks if elements are being removed in 50ms intervals. I assume that, because I mock requests with nock they're resolved immediately, thus some state transitions are missed and tests are flaky. I know I can delay the request, but that will slow down all my tests. I wonder if it is possible to intercept the request and make it pending until explicitly told to replay? Or is there a chance that something like that is going to be added in the future?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I'm testing an app which sends few requests and shows loaders when waiting for the response. The problem is that react-testing-library checks if elements are being removed in 50ms intervals. I assume that, because I mock requests with nock they're resolved immediately, thus some state transitions are missed and tests are flaky. I know I can delay the request, but that will slow down all my tests. I wonder if it is possible to intercept the request and make it pending until explicitly told to replay? Or is there a chance that something like that is going to be added in the future?
Beta Was this translation helpful? Give feedback.
All reactions