Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • T

  • U

Hierarchy

  • AsyncMatchers

Index

Properties

not

not: AsyncMatchers<T, U>

Invert the matcher following this expect.

Methods

toBePending

  • toBePending(expectationFailOutput?: any): PromiseLike<void>
  • Expect a promise to be pending, i.e. the promise is neither resolved nor rejected.

    Parameters

    • Optional expectationFailOutput: any

    Returns PromiseLike<void>

toBeRejected

  • toBeRejected(expectationFailOutput?: any): PromiseLike<void>
  • Expect a promise to be rejected.

    Parameters

    • Optional expectationFailOutput: any

    Returns PromiseLike<void>

toBeRejectedWith

  • Expect a promise to be rejected with a value equal to the expected, using deep equality comparison.

    Parameters

    • expected: Expected<U>

      Value that the promise is expected to be rejected with.

    Returns PromiseLike<void>

toBeRejectedWithError

  • toBeRejectedWithError(expected?: object, message?: string | RegExp): PromiseLike<void>
  • toBeRejectedWithError(message?: string | RegExp): PromiseLike<void>
  • Expect a promise to be rejected with a value matched to the expected.

    Parameters

    • Optional expected: object

      Error constructor the object that was thrown needs to be an instance of. If not provided, Error will be used.

    • Optional message: string | RegExp

      The message that should be set on the thrown Error.

    Returns PromiseLike<void>

  • Expect a promise to be rejected with a value matched to the expected.

    Parameters

    • Optional message: string | RegExp

      The message that should be set on the thrown Error.

    Returns PromiseLike<void>

toBeResolved

  • toBeResolved(expectationFailOutput?: any): PromiseLike<void>
  • Expect a promise to be resolved.

    Parameters

    • Optional expectationFailOutput: any

    Returns PromiseLike<void>

toBeResolvedTo

  • Expect a promise to be resolved to a value equal to the expected, using deep equality comparison.

    Parameters

    • expected: Expected<T>

      Value that the promise is expected to resolve to.

    Returns PromiseLike<void>

withContext

  • Add some context for an expect.

    Parameters

    • message: string

      Additional context to show when the matcher fails.

    Returns AsyncMatchers<T, U>

Generated using TypeDoc