Skip to content

Commit a1ba8a2

Browse files
authored
Merge pull request #8 from DutchCodingCompany/chore/clean_folder_structure
Async bug fix, numeric functions + release 1.1.0
2 parents e84ce2f + 0dc232b commit a1ba8a2

11 files changed

+845
-96
lines changed

analysis_options.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ analyzer:
1313
plugins:
1414
- dart_code_metrics
1515

16-
strong-mode:
17-
implicit-casts: false
18-
1916
language:
2017
strict-casts: true
2118
strict-inference: true
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import 'package:meta/meta.dart';
2+
import 'package:test/test.dart';
3+
4+
import '../parameterized_test.dart';
5+
import 'test_options/group_test_options.dart';
6+
import 'value_source.dart';
7+
8+
/// Create a new parameterizedGroup with given [description], [values] and [body]
9+
///
10+
/// [parameterizedGroup] also have the same options as group tests have. These options will be passed to the group function.
11+
///
12+
/// For example:
13+
/// ```dart
14+
/// parameterizedGroup(
15+
/// 'Amount of letters',
16+
/// [
17+
/// ['kiwi', 4],
18+
/// ['apple', 5],
19+
/// ['banana', 6].withTestOptions(skip: 'skip this'),
20+
/// ],
21+
/// p2((String word, int length) {
22+
/// test('test word length',() {
23+
/// expect(word.length, length);
24+
/// });
25+
/// }),
26+
/// );
27+
/// ```
28+
@isTestGroup
29+
void parameterizedGroup(
30+
/// Group description.
31+
Object description,
32+
33+
/// List of group values. For each values in the list a group test will be executed.
34+
Iterable<dynamic> values,
35+
36+
/// The test body which is executed for each group value.
37+
/// See [TestParameters] for more info on different bodies.
38+
TestParameters body, {
39+
dynamic Function()? setUp,
40+
41+
/// Provide a tearDown function to the `group` test.
42+
dynamic Function()? tearDown,
43+
String? testOn,
44+
Timeout? timeout,
45+
dynamic skip,
46+
dynamic tags,
47+
Map<String, dynamic>? onPlatform,
48+
int? retry,
49+
}) {
50+
ValueSource(
51+
values,
52+
GroupTestOptions(
53+
description: description,
54+
setUp: setUp,
55+
tearDown: tearDown,
56+
testOn: testOn,
57+
timeout: timeout,
58+
skip: skip,
59+
tags: tags,
60+
onPlatform: onPlatform,
61+
retry: retry,
62+
),
63+
).executeGroup(body);
64+
}

0 commit comments

Comments
 (0)