Class MockError

An error related to spying on a function or instance method.

import { MockError, spy } from "@std/testing/mock";
import { assertThrows } from "@std/assert";

assertThrows(() => {
spy({} as any, "no-such-method");
}, MockError);
Hierarchy
  • Error
    • MockError

Constructors

Properties

Constructors

Properties

cause?: unknown
message: string
name: string
stack?: string