test<T extends ApiService> method

void test<T extends ApiService>(
  1. String name,
  2. FutureOr<void> body(), {
  3. Timeout? timeout,
  4. Object? tags,
  5. Map<String, dynamic>? onPlatform,
  6. int? retry,
  7. Object? skip,
  8. String? testOn,
})

Wrapper for defining test bodies.

Wrapping the test body function with this method ensures that the test is run in a service zone which provides access to the ServiceResolver required by the resolve function.

Implementation

void test<T extends ApiService>(
  String name,
  FutureOr<void> Function() body, {
  dartTest.Timeout? timeout,
  Object? tags,
  Map<String, dynamic>? onPlatform,
  int? retry,
  Object? skip,
  String? testOn,
}) {
  dartTest.test(
    name,
    () => runAsService(body),
    timeout: timeout,
    tags: tags,
    onPlatform: onPlatform,
    retry: retry,
    skip: skip,
    testOn: testOn,
  );
}