()
| 348 | } |
| 349 | |
| 350 | useRealTimers(): void { |
| 351 | const global = this._global; |
| 352 | |
| 353 | if (typeof global.cancelAnimationFrame === 'function') { |
| 354 | setGlobal( |
| 355 | global, |
| 356 | 'cancelAnimationFrame', |
| 357 | this._timerAPIs.cancelAnimationFrame, |
| 358 | ); |
| 359 | } |
| 360 | if (typeof global.clearImmediate === 'function') { |
| 361 | setGlobal(global, 'clearImmediate', this._timerAPIs.clearImmediate); |
| 362 | } |
| 363 | setGlobal(global, 'clearInterval', this._timerAPIs.clearInterval); |
| 364 | setGlobal(global, 'clearTimeout', this._timerAPIs.clearTimeout); |
| 365 | if (typeof global.requestAnimationFrame === 'function') { |
| 366 | setGlobal( |
| 367 | global, |
| 368 | 'requestAnimationFrame', |
| 369 | this._timerAPIs.requestAnimationFrame, |
| 370 | ); |
| 371 | } |
| 372 | if (typeof global.setImmediate === 'function') { |
| 373 | setGlobal(global, 'setImmediate', this._timerAPIs.setImmediate); |
| 374 | } |
| 375 | setGlobal(global, 'setInterval', this._timerAPIs.setInterval); |
| 376 | setGlobal(global, 'setTimeout', this._timerAPIs.setTimeout); |
| 377 | |
| 378 | global.process.nextTick = this._timerAPIs.nextTick; |
| 379 | |
| 380 | this._fakingTime = false; |
| 381 | } |
| 382 | |
| 383 | useFakeTimers(): void { |
| 384 | this._createMocks(); |
no test coverage detected