Core Modules@serenity-js/assertionsExpectationscontainAtLeastOneItemThatexternalcontainAtLeastOneItemThat CallablecontainAtLeastOneItemThat<Item>(expectation: Expectation<Item>): Expectation<Item[]>Produces an expectation that is met when the actual array of Item[] contains at least one Item for which the expectation is met. Ensuring that at least one item in an array meets the expectationimport { actorCalled } from '@serenity-js/core'import { Ensure, containAtLeastOneItemThat, isGreaterThan } from '@serenity-js/assertions'const items = [ 10, 15, 20 ]await actorCalled('Ester').attemptsTo( Ensure.that(items, containAtLeastOneItemThat(isGreaterThan(18))),)Type parametersItemParametersexternalexpectation: Expectation<Item>Returns Expectation<Item[]>
Produces an expectation that is met when the actual array of
Item[]
contains at least oneItem
for which theexpectation
is met.Ensuring that at least one item in an array meets the expectation