import { Expectations } from './expectations.ts'; import type { AssertedType, AssertionFunction, InferMatcher, InferToEqual } from './expectations.ts'; import type { Matcher } from './matchers.ts'; import type { Constructor } from './types.ts'; /** * Extension to {@link Expectations} adding support for {@link Promise}s. * * These expectations are _separate_ from the main {@link Expectations}, as we * can't use them in {@link AssertionFunction}s, without ending up with * _unhandled rejections_ in the Node.js process. */ export declare class AsyncExpectations extends Expectations { /** * Create an {@link AsyncExpectations} instance associated with the specified * value and error remarks. */ constructor(value: T, remarks: string | undefined); /** * Expects the value to be a _rejected_ {@link PromiseLike}. * * Negation: {@link Expectations.toBeResolved `toBeResolved(...)`} */ toBeRejected(): Promise>>>; /** * Expects the value to be a _rejected_ {@link PromiseLike}, and further * validates the rejection with a {@link Matcher}. * * Negation: {@link Expectations.toBeResolved `toBeResolved(...)`} */ toBeRejected(matcher: Matcher): Promise>>>; /** * Expects the value to be a _rejected_ {@link PromiseLike}, and further * asserts the rejection reason with an {@link AssertionFunction}. * * Negation: {@link Expectations.toBeResolved `toBeResolved(...)`} */ toBeRejected(assertion: AssertionFunction): Promise>>>; /** * Expects the value to be a {@link PromiseLike} _rejected_ with an * {@link Error} {@link Expectations.toStrictlyEqual _strictly equal_} * to the one specified. * * Negation: {@link Expectations.toBeResolved `toBeResolved(...)`} */ toBeRejectedWith(expected: Error): Promise>>>; /** * Expect the value to be a _rejected_ {@link PromiseLike}, and further * asserts the rejection reason to be an {@link Error}. * * If specified, the {@link Error}'s own message will be further expected to * either match the specified {@link RegExp}, or equal to the specified * `string`. * * Negation: {@link Expectations.toBeResolved `toBeResolved(...)`} */ toBeRejectedWithError(message?: string | RegExp, substring?: boolean): Promise>>>; /** * Expect the value to be a _rejected_ {@link PromiseLike}, and further * asserts the rejection reason to be an instance of the specifed * {@link Error} {@link Constructor}. * * If specified, the {@link Error}'s own message will be further expected to * either match the specified {@link RegExp}, or equal to the specified * `string`. * * Negation: {@link Expectations.toBeResolved `toBeResolved(...)`} */ toBeRejectedWithError(constructor: Constructor, message?: string | RegExp, substring?: boolean): Promise>>>; /** * Expects the value to be a _resolved_ {@link PromiseLike}. * * Negation: {@link Expectations.toBeRejected `toBeRejected(...)`} */ toBeResolved(): Promise>>>; /** * Expects the value to be a _resolved_ {@link PromiseLike}, and further * validates the resolved result with a {@link Matcher}. * * Negation: {@link Expectations.toBeRejected `toBeRejected(...)`} */ toBeResolved(matcher: Match): Promise>>>; /** * Expects the value to be a _resolved_ {@link PromiseLike}, and further * asserts the resolved result with an {@link AssertionFunction}. * * Negation: {@link Expectations.toBeRejected `toBeRejected(...)`} */ toBeResolved>>(assertion: Assert): Promise, Assert>>>>; /** * Expects the value to be a {@link PromiseLike} _resolved_ with a value * {@link Expectations.toEqual _deeply equal_} to the one specified. * * Negation: {@link Expectations.toBeRejected `toBeRejected(...)`} */ toBeResolvedWith(expected: Type): Promise>>>; } //# sourceMappingURL=async.d.ts.map