expectSync function

void expectSync(
  1. dynamic actual,
  2. dynamic matcher,
  3. {String? reason}

Assert that actual matches matcher.

See matcher_expect.expect for details. This variant will not check that there are no outstanding asynchronous API requests. As such, it can be called from, e.g., callbacks that are run during build or layout, or in the completion handlers of futures that execute in response to user input.

Generally, it is better to use expect, which does include checks to ensure that asynchronous APIs are not being called.


void expectSync(
  dynamic actual,
  dynamic matcher, {
  String? reason,
}) {
  matcher_expect.expect(actual, matcher, reason: reason);