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); Copy
import { MockError, spy } from "@std/testing/mock";import { assertThrows } from "@std/assert";assertThrows(() => { spy({} as any, "no-such-method");}, MockError);
Construct MockError
The error message.
Optional
An error related to spying on a function or instance method.
Example: Usage