Skip to main content
Go to Latest
interface ConstructorSpy
import { type ConstructorSpy } from "";

A constructor wrapper that records all calls made to it.

Type Parameters

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


original: new (...args: Args) => Self

The function that is being spied on.

calls: SpyCall<Self, Args, Self>[]

Information about calls made to the function or instance method.

restored: boolean

Whether or not the original instance method has been restored.


new(...args: Args): Self
restore(): void

If spying on an instance method, this restores the original instance method.