You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Take Condition for async nesting expectations (#1896)
Avoid the awkwardness of awaiting before chaining conditions, or needing
a `which` utility to chain on a Future.
This introduces a discrepancy between chaining for sync vs async
expectations, but it makes many common async expectations nicer to read.
- Remove `which` and a reference to it in README.
- Update `nestAsync` to take `nestedCondition` argument instead of
returning a `Subject`. This forces all async conditions to follow the
same pattern.
- Update `nestAsync` doc example to use the new signature.
- Mention how to check subsequent conditions in the doc for `nest`, and
in the doc for `nestAsync` explicitly contrast with `nest`.
- Remove now unnecessary nesting handling from `_ReplayContext`.
- Update all async expectations using `nestAsync` to use the new
signature and describe usage in their docs.
- Add `_LazyCondition` in `test_shared.dart`. This could prove useful
enough to put directly in `Condition` at some point. This allows the
condition that runs to be based on the `actual` value from the
predicate, which is an unusual situation for testing within the
library since it mirrors the defaulting that happens in
`_TestContext`.
0 commit comments