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
`Changed from using fake timers to real timers while using waitFor. This is not allowed and will result in very strange behavior. Please ensure you're awaiting all async things your test is doing before changing to real timers. For more info, please go to https://github.com/testing-library/dom-testing-library/issues/830`
97
+
)
98
+
copyStackTrace(error,stackTraceError)
99
+
reject(error)
100
+
return
101
+
}
102
+
// we *could* (maybe should?) use `advanceTimersToNextTimer` but it's
103
+
// possible that could make this loop go on forever if someone is using
104
+
// third party code that's setting up recursive timers so rapidly that
105
+
// the user's timer's don't get a chance to resolve. So we'll advance
106
+
// by an interval instead. (We have a test for this case).
107
+
jest.advanceTimersByTime(interval)
108
+
109
+
// It's really important that checkCallback is run *before* we flush
110
+
// in-flight promises. To be honest, I'm not sure why, and I can't quite
111
+
// think of a way to reproduce the problem in a test, but I spent
112
+
// an entire day banging my head against a wall on this.
113
+
checkCallback()
114
+
115
+
if(finished){
116
+
break
117
+
}
118
+
119
+
// In this rare case, we *need* to wait for in-flight promises
120
+
// to resolve before continuing. We don't need to take advantage
0 commit comments