Interface Assertions<T, N>
interface Assertions<T, N> { not: N; toBe(expected: T): void; toBeFalsy(): void; toBeOfType<U>( ...params: <V>() => V extends T ? 1 : 2 extends <V>() => V extends U ? 1 : 2 ? [] : ["ERROR: The types are not the same"], ): void; toBeTruthy(): void; toEqual(expected: Exclude<T, Function | Promise<unknown>>): void; toReject(expectedError?: string | RegExp | Error): Promise<void>; toResolve(expected?: Awaited<T>): Promise<void>; toThrow(expectedError?: string | RegExp | Error): void;} Properties
Methods
toBe
- toBe(expected: T): void
Returns void
toBeFalsy
- toBeFalsy(): void
Returns void
toBeOfType
- toBeOfType<U>(
...params: <V>() => V extends T ? 1 : 2 extends <V>() => V extends U
? 1
: 2
? []
: ["ERROR: The types are not the same"],
): void Parameters
- ...params: <V>() => V extends T ? 1 : 2 extends <V>() => V extends U ? 1 : 2
? []
: ["ERROR: The types are not the same"]
Returns void
toBeTruthy
- toBeTruthy(): void
Returns void
toEqual
- toEqual(expected: Exclude<T, Function | Promise<unknown>>): void
Parameters
- expected: Exclude<T, Function | Promise<unknown>>
Returns void
toReject
- toReject(expectedError?: string | RegExp | Error): Promise<void>
Parameters
Optional
expectedError: string | RegExp | Error
Returns Promise<void>
toResolve
- toResolve(expected?: Awaited<T>): Promise<void>
Parameters
Optional
expected: Awaited<T>
Returns Promise<void>
toThrow
- toThrow(expectedError?: string | RegExp | Error): void
Parameters
Optional
expectedError: string | RegExp | Error
Returns void
Assertions