Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ analyzer:
plugins:
- dart_code_metrics

strong-mode:
implicit-casts: false

language:
strict-casts: true
strict-inference: true
Expand Down
64 changes: 64 additions & 0 deletions lib/src/parameterized_group_base.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import 'package:meta/meta.dart';
import 'package:test/test.dart';

import '../parameterized_test.dart';
import 'test_options/group_test_options.dart';
import 'value_source.dart';

/// Create a new parameterizedGroup with given [description], [values] and [body]
///
/// [parameterizedGroup] also have the same options as group tests have. These options will be passed to the group function.
///
/// For example:
/// ```dart
/// parameterizedGroup(
/// 'Amount of letters',
/// [
/// ['kiwi', 4],
/// ['apple', 5],
/// ['banana', 6].withTestOptions(skip: 'skip this'),
/// ],
/// p2((String word, int length) {
/// test('test word length',() {
/// expect(word.length, length);
/// });
/// }),
/// );
/// ```
@isTestGroup
void parameterizedGroup(
/// Group description.
Object description,

/// List of group values. For each values in the list a group test will be executed.
Iterable<dynamic> values,

/// The test body which is executed for each group value.
/// See [TestParameters] for more info on different bodies.
TestParameters body, {
dynamic Function()? setUp,

/// Provide a tearDown function to the `group` test.
dynamic Function()? tearDown,
String? testOn,
Timeout? timeout,
dynamic skip,
dynamic tags,
Map<String, dynamic>? onPlatform,
int? retry,
}) {
ValueSource(
values,
GroupTestOptions(
description: description,
setUp: setUp,
tearDown: tearDown,
testOn: testOn,
timeout: timeout,
skip: skip,
tags: tags,
onPlatform: onPlatform,
retry: retry,
),
).executeGroup(body);
}
Loading