/** * E2E Test Runner - Expect Function * * Fluent assertion API with .not modifier support. * Throws AssertionError on failure with detailed information. */ /** * Expectation interface with all matcher methods */ export interface Expectation { /** * Negates the following matcher */ not: Expectation; /** * Strict equality (===) */ toBe(expected: T): void; /** * Deep equality comparison */ toEqual(expected: T): void; /** * Check if value is one of the expected values */ toBeOneOf(expected: T[]): void; /** * Check if value is defined (not undefined) */ toBeDefined(): void; /** * Check if value is undefined */ toBeUndefined(): void; /** * Check if value is null */ toBeNull(): void; /** * Check if value is not null */ toBeNotNull(): void; /** * Check if value is truthy */ toBeTruthy(): void; /** * Check if value is falsy */ toBeFalsy(): void; /** * Check if array/string contains an item */ toContain(item: unknown): void; /** * Check if array/string/object has specific length */ toHaveLength(length: number): void; /** * Check if string matches a pattern */ toMatch(pattern: RegExp | string): void; /** * Check if number is greater than value */ toBeGreaterThan(value: number): void; /** * Check if number is greater than or equal to value */ toBeGreaterThanOrEqual(value: number): void; /** * Check if number is less than value */ toBeLessThan(value: number): void; /** * Check if number is less than or equal to value */ toBeLessThanOrEqual(value: number): void; /** * Check if object has a property at the given path */ toHaveProperty(path: string, value?: unknown): void; /** * Check if value is of a specific type */ toBeType(type: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'function' | 'undefined' | 'null'): void; } /** * The expect function signature */ export type ExpectFunction = (actual: T) => Expectation; /** * Create an expectation for a value * * @param actual - The value to test * @returns An expectation object with assertion methods * * @example * expect(5).toBe(5); * expect('hello').toContain('ell'); * expect(value).not.toBeNull(); */ export declare function expect(actual: T): Expectation; /** * Assert that a condition is true * * @param condition - The condition to check * @param message - Optional message on failure * @throws AssertionError if condition is false */ export declare function assert(condition: boolean, message?: string): asserts condition; /** * Assert that a condition is false * * @param condition - The condition to check * @param message - Optional message on failure * @throws AssertionError if condition is true */ export declare function assertFalse(condition: boolean, message?: string): void; /** * Force a test to fail with a message * * @param message - The failure message * @throws AssertionError always */ export declare function fail(message: string): never; /** * Assert that code throws an error * * @param fn - The function to execute * @param expected - Optional expected error message, class, or regex * @throws AssertionError if function doesn't throw or throws wrong error */ export declare function assertThrows(fn: () => unknown, expected?: string | RegExp | (new (...args: unknown[]) => Error)): void; /** * Assert that async code throws an error * * @param fn - The async function to execute * @param expected - Optional expected error message, class, or regex * @throws AssertionError if function doesn't throw or throws wrong error */ export declare function assertThrowsAsync(fn: () => Promise, expected?: string | RegExp | (new (...args: unknown[]) => Error)): Promise; export { formatValue } from './matchers'; //# sourceMappingURL=expect.d.ts.map