import { Assertion } from './smartexpect.classes.assertion.js'; // import type { TMatcher } from './smartexpect.classes.assertion.js'; // unused /** * 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 function expect(value: Promise): Assertion; export function expect(value: T): Assertion; export function expect(value: any): Assertion { const isThenable = value != null && typeof (value as any).then === 'function'; const mode: 'sync' | 'async' = isThenable ? 'async' : 'sync'; return new Assertion(value, mode); } /** * Register custom matchers. */ export namespace expect { export const extend = Assertion.extend; } /** * @deprecated Use `expect(...)` with `.resolves` or `.rejects` instead. */ /** * @deprecated Use `expect(...)` with `.resolves` or `.rejects` instead. */ /** * @deprecated Use `expect(...)` with `.resolves` or `.rejects` instead. */ export const expectAsync = (baseArg: any) => { // eslint-disable-next-line no-console console.warn('[DEPRECATED] expectAsync() is deprecated. Use expect(...).resolves / .rejects'); return new Assertion(baseArg, 'async'); };