Skip to main content

externalcontainItemsWhereEachItem

Callable


  • Produces an expectation that is met when all the items of the actual array of Item[] meet the expectation.

    Ensuring that all the items in an array meet the expectation

    import { actorCalled } from '@serenity-js/core'
    import { Ensure, containItemsWhereEachItem, endsWith } from '@serenity-js/assertions'

    const items = [ 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday' ]

    await actorCalled('Ester').attemptsTo(
    Ensure.that(items, containItemsWhereEachItem(endsWith('day'))),
    )

    Type parameters

    • Actual

    Parameters

    Returns Expectation<Actual[]>