testWidgets function

  1. @isTest
void testWidgets(
  1. WidgetTesterCallback callback, {
  2. bool? skip,
  3. Timeout? timeout,
  4. bool semanticsEnabled = true,
  5. TestVariant<Object?> variant = const ft.DefaultTestVariant(),
  6. dynamic tags,
})

Test with preparing unit testing environment for given/when/then methods

An exception will be thrown if you don't wrap a test body by this.

Example:

testWidgets((tester) async {
  given(...);
  when(...);
  then(...);
});

Implementation

@isTest
void testWidgets(
  ft.WidgetTesterCallback callback, {
  bool? skip,
  ft.Timeout? timeout,
  bool semanticsEnabled = true,
  ft.TestVariant<Object?> variant = const ft.DefaultTestVariant(),
  dynamic tags,
}) {
  ft.testWidgets(
    '',
    gwt_(callback),
    skip: skip,
    timeout: timeout,
    semanticsEnabled: semanticsEnabled,
    variant: variant,
    tags: tags,
  );
}