testComponents function

  1. @isTest
void testComponents(
  1. String description,
  2. FutureOr<void> callback(
    1. ComponentTester tester
    ), {
  3. Uri? uri,
  4. bool isClient = false,
  5. bool? skip,
  6. Timeout? timeout,
  7. dynamic tags,
})

Implementation

@isTest
void testComponents(
  String description,
  FutureOr<void> Function(ComponentTester tester) callback, {
  Uri? uri,
  bool isClient = false,
  bool? skip,
  Timeout? timeout,
  dynamic tags,
}) {
  test(
    description,
    () async {
      var binding = TestComponentsBinding(uri ?? Uri.parse('/'), isClient);
      var tester = ComponentTester._(binding);

      return binding.runTest(() async {
        await callback(tester);
      });
    },
    skip: skip,
    timeout: timeout,
    tags: tags,
  );
}