testComponents function

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

Implementation

@isTest
void testComponents(
  String description,
  FutureOr<void> Function(ComponentTester tester) callback, {
  String? url,
  bool isClient = true,
  bool? skip,
  Timeout? timeout,
  Object? tags,
}) {
  test(
    description,
    () async {
      final binding = TestComponentsBinding(url ?? '/', isClient);
      final tester = ComponentTester._(binding);

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