MCPcopy Create free account
hub / github.com/denoland/std / restore

Method restore

testing/time.ts:399–404  ·  view source on GitHub ↗

* Restores real time. * * @throws {TimeError} If time is already restored * * @example Usage * ```ts * import { FakeTime } from "@std/testing/time"; * import { assertEquals, assertNotEquals } from "@std/assert" * * const setTimeout = globalThis.setTimeout; * * const

()

Source from the content-addressed store, hash-verified

397 * ```
398 */
399 static restore() {
400 if (!time) {
401 throw new TimeError("Cannot restore time: time is already restored");
402 }
403 time.restore();
404 }
405
406 /**
407 * Restores real time temporarily until callback returns and resolves.

Callers 1

[Symbol.dispose]Method · 0.95

Calls 2

restoreGlobalsFunction · 0.85
restoreMethod · 0.65

Tested by

no test coverage detected