There are currently 2 styles of writing tests which check "nested" conditions - conditions that are checked against a value derived from the original subject. Synchronous checks nest with method chaining like check(foo).isNotNull().isGreaterThan(1), while asynchronous checks nest with Condition callbacks await check(foo).completes((it) => it.isGreaterThan(1));. The reason for the divergence is the awkward syntax needed to handle the await for nesting await (await check(foo).completes()).isGreaterThan(1);
Some authors may have a preference to match the styles. We could normalize these and allow either style - synchronous nested checks with Condition arguments and asynchronous nested checks that return Future<Subject>. The reason not to do this is it violates the preference for having one way of accomplishing goals and forcing a choice onto every author. If we don't do this there will be authors who are disappointed not to be able to use their preferred style.
I have a PR which does this #2683 - but I haven't asked folks to decide their preference because I was pushing on a PR for #2694 too which is worth considering together.
There are currently 2 styles of writing tests which check "nested" conditions - conditions that are checked against a value derived from the original subject. Synchronous checks nest with method chaining like
check(foo).isNotNull().isGreaterThan(1), while asynchronous checks nest withConditioncallbacksawait check(foo).completes((it) => it.isGreaterThan(1));. The reason for the divergence is the awkward syntax needed to handle theawaitfor nestingawait (await check(foo).completes()).isGreaterThan(1);Some authors may have a preference to match the styles. We could normalize these and allow either style - synchronous nested checks with
Conditionarguments and asynchronous nested checks that returnFuture<Subject>. The reason not to do this is it violates the preference for having one way of accomplishing goals and forcing a choice onto every author. If we don't do this there will be authors who are disappointed not to be able to use their preferred style.I have a PR which does this #2683 - but I haven't asked folks to decide their preference because I was pushing on a PR for #2694 too which is worth considering together.