Core Modules@serenity-js/assertionsExpectationscontainItemsWhereEachItemexternalcontainItemsWhereEachItem CallablecontainItemsWhereEachItem<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 expectationimport { 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 parametersActualParametersexternalexpectation: Expectation<Actual>Returns Expectation<Actual[]>
Produces an expectation that is met when all the items of the actual array of
Item[]
meet theexpectation
.Ensuring that all the items in an array meet the expectation