UNPKG

@push.rocks/smartexpect

Version:

A testing library to manage expectations in code, offering both synchronous and asynchronous assertion methods.

19 lines (18 loc) 824 B
import { Assertion } from '../smartexpect.classes.assertion.js'; import type { TExecutionType } from '../types.js'; /** * Namespace for function-specific matchers */ export declare class FunctionMatchers<M extends TExecutionType> { private assertion; constructor(assertion: Assertion<Function, M>); toThrow(expectedError?: any): M extends "async" ? Promise<Assertion<Function, M>> : Assertion<Function, M>; /** * Assert thrown error message matches the given regex */ toThrowErrorMatching(regex: RegExp): M extends "async" ? Promise<Assertion<Function, M>> : Assertion<Function, M>; /** * Assert thrown error message equals the given string */ toThrowErrorWithMessage(expectedMessage: string): M extends "async" ? Promise<Assertion<Function, M>> : Assertion<Function, M>; }