std/testing/mock.ts

Deno standard library
Go to Latest
function mockSession
import { mockSession } from "https://deno.land/std@0.145.0/testing/mock.ts?s=mockSession";

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

Type Parameters

Self[src]
Args extends unknown[][src]
Return[src]

Parameters

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

Returns

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

Type Parameters

Self[src]
Args extends unknown[][src]
Return[src]

Parameters

optional
func: (this: Self, ...args: Args) => Return
[src]

Returns

number | ((this: Self, ...args: Args) => Return)[src]