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

x/rimbu/spy/index.ts>Spy

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

Contains functions that can be used to Spy, Stub, and partially Mock functions, objects and classes.

Functions

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

Returns a spied function instance that tracks the function calls and optionally uses some original or stub implementation.

Returns a tuple containing the spied object, and the metadata object giving more information about the stubbed object.

Interfaces

The metadata object type for a spied class.

The spied function type containing extra information about the function calls.

The extra information added to spied functions.

The additional information available for spied objects.

Type Aliases

The resulting tuple type of the Spy.cls function containing the resulting spy class, and the metadata object containing extra information about the created instances.

Spy object type of a spied class, containing extra metadata compared to object spies.

The allowed values to supply to a stub spy function implementation. Either a simple stub item or a sequence of stub items.

A single function stub return item.

A method call tuple containing the called method name first, and then the corresponding parameters used.

The spied object type, where the object methods/functions are augmented with spy information.

A stub implementation type for objects of type T.