ConstructorSpy
import { ConstructorSpy } from "jsr:@ende/testing/mock";interface
interface ConstructorSpy<Self = any, Args extends unknown[] = any[]>A constructor wrapper that records all calls made to it.
Constructors
constructor
new ConstructorSpy(...args: Args): SelfConstruct an instance.
Properties
original
original: new (...args: Args) => SelfThe function that is being spied on.
calls
calls: SpyCall<Self, Args, Self>[]Information about calls made to the function or instance method.
restored
restored: booleanWhether or not the original instance method has been restored.
Methods
restore
restore(): voidIf spying on an instance method, this restores the original instance method.