Skip to main content
Module

x/mock/mod.ts>mockSession

Utilities to help mock behavior, spy on function calls, stub methods, and fake time for tests.
Very Popular
Latest
function mockSession
import { mockSession } from "https://deno.land/x/mock@0.15.2/mod.ts";

Creates a session that tracks all mocks created before it's restored. If a callback is provided, it restores all mocks created within it.

Returns

number

Type Parameters

Self
Args extends unknown[]
Return

Parameters

func: (this: Self, ...args: Args) => Return

Returns

(this: Self, ...args: Args) => Return