UNPKG

@push.rocks/smartexpect

Version:

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

23 lines (22 loc) 1.32 kB
import { Assertion } from '../smartexpect.classes.assertion.js'; import type { TExecutionType } from '../types.js'; /** * Namespace for array-specific matchers */ export declare class ArrayMatchers<T, M extends TExecutionType> { private assertion; constructor(assertion: Assertion<T[], M>); toBeArray(): M extends "async" ? Promise<Assertion<T[], M>> : Assertion<T[], M>; toHaveLength(length: number): M extends "async" ? Promise<Assertion<T[], M>> : Assertion<T[], M>; toContain(item: T): M extends "async" ? Promise<Assertion<T[], M>> : Assertion<T[], M>; toContainEqual(item: T): M extends "async" ? Promise<Assertion<T[], M>> : Assertion<T[], M>; toContainAll(items: T[]): M extends "async" ? Promise<Assertion<T[], M>> : Assertion<T[], M>; toExclude(item: T): M extends "async" ? Promise<Assertion<T[], M>> : Assertion<T[], M>; toBeEmptyArray(): M extends "async" ? Promise<Assertion<T[], M>> : Assertion<T[], M>; /** * Alias for empty array check */ toBeEmpty(): M extends "async" ? Promise<Assertion<T[], M>> : Assertion<T[], M>; toHaveLengthGreaterThan(length: number): M extends "async" ? Promise<Assertion<T[], M>> : Assertion<T[], M>; toHaveLengthLessThan(length: number): M extends "async" ? Promise<Assertion<T[], M>> : Assertion<T[], M>; }