expectSync function

void expectSync (dynamic actual, dynamic matcher, { String reason })

Assert that actual matches matcher.

See test_package.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.

Implementation

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