()
| 421 | } |
| 422 | |
| 423 | private _checkFakeTimers() { |
| 424 | if (!this._fakingTime) { |
| 425 | this._global.console.warn( |
| 426 | 'A function to advance timers was called but the timers APIs are not mocked ' + |
| 427 | 'with fake timers. Call `jest.useFakeTimers({legacyFakeTimers: true})` ' + |
| 428 | 'in this test file or enable fake timers for all tests by setting ' + |
| 429 | "{'enableGlobally': true, 'legacyFakeTimers': true} in " + |
| 430 | `Jest configuration file.\nStack Trace:\n${formatStackTrace( |
| 431 | // eslint-disable-next-line unicorn/error-message |
| 432 | new Error().stack!, |
| 433 | this._config, |
| 434 | {noStackTrace: false}, |
| 435 | )}`, |
| 436 | ); |
| 437 | } |
| 438 | } |
| 439 | |
| 440 | #createMockFunction<T extends FunctionLike = UnknownFunction>( |
| 441 | implementation: T, |
no test coverage detected