Creates a function that returns the instance the method was called on.
The self type of the returned function.
The arguments type of the returned function.
A function that returns the instance the method was called on.
Rest
import { returnsThis } from "@std/testing/mock";import { assertEquals } from "@std/assert";const func = returnsThis();const obj = { func };assertEquals(obj.func(), obj); Copy
import { returnsThis } from "@std/testing/mock";import { assertEquals } from "@std/assert";const func = returnsThis();const obj = { func };assertEquals(obj.func(), obj);
Creates a function that returns the instance the method was called on.