test function

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

Drop-in replacement for flutter_test's test with Allure reporting.

Implementation

void test(
  Object? description,
  dynamic Function() body, {
  String? testOn,
  ft.Timeout? timeout,
  Object? skip,
  Object? tags,
  Map<String, dynamic>? onPlatform,
  int? retry,
}) {
  _ensureAllureInstalled();
  final prepared = preparePackageTestDeclaration(
    description: description,
    skip: skip,
    tags: tags,
    stackTrace: StackTrace.current,
    ignoredLibrarySuffixes: _ignoredLibrarySuffixes,
  );

  dynamic Function() effectiveBody = body;
  if (prepared.shouldRuntimeSkip) {
    effectiveBody = () => ft.markTestSkipped(prepared.runtimeSkipReason);
  }

  ft.test(
    description ?? '',
    effectiveBody,
    testOn: testOn,
    timeout: timeout,
    skip: prepared.declarationSkip,
    tags: tags,
    onPlatform: onPlatform,
    retry: retry,
  );
}