Skip to main content

externalisCloseTo

Callable


  • Produces an 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

     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))
    )

    Parameters

    • externalrest...answerableArguments: [expected: Answerable<number>, absoluteTolerance: Answerable<number>]

    Returns Expectation<number>