Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/spy/mod.ts>Spy.cls

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
function Spy.cls
import { Spy } from "https://deno.land/x/rimbu@1.2.0/spy/mod.ts";
const { cls } = Spy;

Returns a tuple containing a spied class and an object containing extra information about the created class instances.

Type Parameters

I
optional
A extends any[] = I extends Construct ? ConstructorParameters<I> : []

Parameters

optional
originalClass: Construct<A, I>
  • (optional) the class to spy on
optional
originalStubs: Partial<I>
  • (optional) the default stubs to use for each created instance
optional
originalConstructorStub: Func<A, I>
  • (optional) a function to call instead of the class constructor