UNPKG

@serenity-js/assertions

Version:

Serenity/JS universal assertion library supporting all types of functional tests, including both web and REST API scenarios

24 lines 924 B
import { Expectation } from '@serenity-js/core'; /** * Produces an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual value * is within a given ± `absoluteTolerance` range of the `expected` value. * * ## Ensuring that a given floating point number is close to the expected number * * ```ts * import { actorCalled } from '@serenity-js/core' * import { Ensure, isCloseTo } from '@serenity-js/assertions' * * await actorCalled('Iris').attemptsTo( * Ensure.that(10.123, isCloseTo(10, 0.2)) * ) * ``` * * @param expected * @param [absoluteTolerance=1e-9] * Absolute ± tolerance range, defaults to `1e-9` * * @group Expectations */ export declare const isCloseTo: (expected: import("@serenity-js/core").Answerable<number>, absoluteTolerance?: import("@serenity-js/core").Answerable<number>) => Expectation<number>; //# sourceMappingURL=isCloseTo.d.ts.map