Skip to main content



  • containItemsWhereEachItem<Actual>(expectation: Expectation<Actual>): Expectation<Actual[]>

  • 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


    • expectation: Expectation<Actual>

    Returns Expectation<Actual[]>