This adds AsyncPredicate, a companion to Predicate which works with AsyncExpression for creating matchers that can utilize async/await.
AsyncPredicate does not replace or subsume Predicate, this is an entirely additive change.
Creates an async variant of containsElementSatisfying that takes in an async function. Does not replace the existing containsElementSatisfying.
Creates variants of satisfyAnyOf and satisfyAllOf that take in both AsyncPredicate and Predicate. Again, these do not replace the existing satisfyAnyOf/satisfyAllOf matchers, but instead complements them so that you can compose matchers that use both AsyncPredicate and traditional Predicate.
Creates async variants of allPass.
Updates documentation.
Checklist - While not every PR needs it, new features should consider this list:
[x] Does this have tests?
[x] Does this have documentation?
[ ] Does this break the public API (Requires major version bump)?
[x] Is this a new feature (Requires minor version bump)?
AsyncPredicate
, a companion toPredicate
which works withAsyncExpression
for creating matchers that can utilize async/await.AsyncPredicate
does not replace or subsumePredicate
, this is an entirely additive change.containsElementSatisfying
that takes in an async function. Does not replace the existingcontainsElementSatisfying
.satisfyAnyOf
andsatisfyAllOf
that take in bothAsyncPredicate
andPredicate
. Again, these do not replace the existingsatisfyAnyOf
/satisfyAllOf
matchers, but instead complements them so that you can compose matchers that use bothAsyncPredicate
and traditionalPredicate
.allPass
.Checklist - While not every PR needs it, new features should consider this list: