Skip to main content



  • isCloseTo(...answerableArguments: [expected: Answerable<number>, absoluteTolerance: Answerable<number>]): Expectation<number>

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


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

    Returns Expectation<number>