Interface NotAssertions<T>

Negated assertions

interface NotAssertions<T> {
    toBe(unexpected: T): void;
    toBeFalsy(): void;
    toBeOfType<U>(
        ...params: <V>() => V extends T ? 1 : 2 extends <V>() => V extends U
            ? 1
            : 2
            ? ["ERROR: The types are the same"]
            : [],
    ): void;
    toBeTruthy(): void;
    toEqual(unexpected: Exclude<T, Function | Promise<unknown>>): void;
    toReject(): Promise<void>;
    toThrow(): void;
}

Type Parameters

  • T

Methods

  • Assert that the actual and unexpected values are not identical (i.e. not the same instance)

    Parameters

    • unexpected: T

      The unexpected value

    Returns void

    If the actual and expected values are identical

  • Assert that the actual value is not falsy

    Returns void

    If the actual value is falsy

  • Assert that the actual value is not of the specified type

    Type Parameters

    • U

    Parameters

    • ...params: <V>() => V extends T ? 1 : 2 extends <V>() => V extends U ? 1 : 2
          ? ["ERROR: The types are the same"]
          : []

    Returns void

  • Assert that the actual value is not truthy

    Returns void

    If the actual value is truthy

  • Assert that the actual and unexpected values are not equal (i.e. don't have the same content)

    Parameters

    • unexpected: Exclude<T, Function | Promise<unknown>>

      The unexpected value

    Returns void

    If the actual and expected values are equal (have the same content)

  • Assert that the promise does not reject

    Returns Promise<void>

    If the promise rejects

  • Assert that the actual function completes without throwing an error

    Returns void

    If the code block throws an error