std/testing/mock.ts

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

Creates a function that returns the instance the method was called on.

Type Parameters

optional
Self = any
[src]
optional
Args extends unknown[] = any[]
[src]

Returns

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