()
| 141 | } |
| 142 | |
| 143 | function checkRealTimersCallback() { |
| 144 | if (jestFakeTimersAreEnabled()) { |
| 145 | const error = new Error( |
| 146 | `Changed from using real timers to fake 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 fake timers. For more info, please go to https://github.com/testing-library/dom-testing-library/issues/830`, |
| 147 | ); |
| 148 | copyStackTraceIfNeeded(error, stackTraceError); |
| 149 | return onDone({ type: 'error', error }); |
| 150 | } else { |
| 151 | return checkExpectation(); |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | function checkExpectation() { |
| 156 | /* istanbul ignore next */ |
nothing calls this directly
no test coverage detected
searching dependent graphs…