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

Function restore

testing/mock.ts:597–607  ·  view source on GitHub ↗
(id?: number)

Source from the content-addressed store, hash-verified

595 * @param id The id of the session to restore. If not provided, all mocks registered in the current session are restored.
596 */
597export function restore(id?: number) {
598 id ??= (sessions.length || 1) - 1;
599 while (id < sessions.length) {
600 const session = sessions.pop();
601 if (session) {
602 for (const value of session) {
603 value.restore();
604 }
605 }
606 }
607}
608
609/** Wraps an instance method with a Spy. */
610function methodSpy<

Calls 2

restoreMethod · 0.65
popMethod · 0.45

Tested by

no test coverage detected