Skip to main content

externalcontainAtLeastOneItemThat

Callable


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

    import { 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 parameters

    • Item

    Parameters

    Returns Expectation<Item[]>