// We copy types from frameworks here so we have no dependency on jest, jasmine or vitest when running in a consuming project that will not have types for these frameworks. export interface ExpectExtend { extend: (matchers: Record) => void; } /** * Copied here from Jest types to avoid the need for consuming projects to install Jest types */ export interface IJestCustomMatcherResult { pass: boolean; message: () => string; } /** * Copied here from Jasmine types to avoid the need for consuming projects to install Jasmine types */ export interface IJasmineCustomMatcherResult { pass: boolean; message?: string; } export interface ICustomMatcher { compare(actual: T, expected: T, ...args: any[]): IJasmineCustomMatcherResult; compare(actual: any, ...expected: any[]): IJasmineCustomMatcherResult; negativeCompare?(actual: T, expected: T, ...args: any[]): IJasmineCustomMatcherResult; negativeCompare?(actual: any, ...expected: any[]): IJasmineCustomMatcherResult; } type TestLifecycleListener = () => Promise | void; export type afterAll = (fn: TestLifecycleListener, timeout?: number) => void; export type afterEach = (fn: TestLifecycleListener, timeout?: number) => void; export type beforeAll = (fn: TestLifecycleListener, timeout?: number) => void; export type beforeEach = (fn: TestLifecycleListener, timeout?: number) => void;