Core Modules@serenity-js/assertionsExpectationsisLessThanexternalisLessThan CallableisLessThan(...answerableArguments: [expected: Answerable<number>]): Expectation<number>Creates an expectation that is met when the actual value of type number is less than the expected number. Ensuring that a given number is less than the expected numberimport { actorCalled } from '@serenity-js/core'import { Ensure, isLessThan } from '@serenity-js/assertions'await actorCalled('Ester').attemptsTo( Ensure.that(5, isLessThan(10)),) Ensuring that a given number is within the expected rangeimport { actorCalled, Expectation, d } from '@serenity-js/core'import { Ensure, and, equals, isGreaterThan, isLessThan, or } from '@serenity-js/assertions'const isWithinRange = (lowerBound: Answerable<number>, upperBound: Answerable<number>) => Expectation.to(d`have value that is between ${ lowerBound } and ${ upperBound }`) .soThatActual( and( or(equals(lowerBound), isGreaterThan(lowerBound)), or(equals(upperBound), isLessThan(upperBound)), ) ),await actorCalled('Ester').attemptsTo( Ensure.that( 7, isWithinRange(5, 10) ),)Parametersexternalrest...answerableArguments: [expected: Answerable<number>]Returns Expectation<number>
Creates an expectation that is met when the actual value of type
number
is less than the expectednumber
.Ensuring that a given number is less than the expected number
Ensuring that a given number is within the expected range