@push.rocks/smartexpect
Version:
A testing library to manage expectations in code, offering both synchronous and asynchronous assertion methods.
29 lines (28 loc) • 924 B
TypeScript
import { Assertion, AnyMatcher, AnythingMatcher } from './smartexpect.classes.assertion.js';
/**
* Primary entry point for assertions.
* Automatically detects Promises to support async assertions.
*/
/**
* The `expect` function interface. Supports custom matchers via .extend.
*/
/**
* Entry point for assertions.
* Automatically detects Promises to support async assertions.
*/
export declare function expect<T>(value: Promise<T>): Assertion<T, 'async'>;
export declare function expect<T>(value: T): Assertion<T, 'sync'>;
/**
* Register custom matchers.
*/
export declare namespace expect {
const extend: typeof Assertion.extend;
/**
* Matcher for a specific constructor. Passes if value is instance of given constructor.
*/
function any(constructor: any): AnyMatcher;
/**
* Matcher for any defined value (not null or undefined).
*/
function anything(): AnythingMatcher;
}