parameterizedGroup top-level property

  1. @isTestGroup
ParameterizedTest parameterizedGroup

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:

parameterizedGroup(
  'Amount of letters',
  [
    ['kiwi', 4],
    ['apple', 5],
    ['banana', 6].options(skip: 'skip this'),
  ],
  (String word, int length) {
    test('test word length',() {
      expect(word.length, length);
      });
  },
);

Implementation

// ignore: comment_references
/// Create a new parameterizedGroup with given [description], [values]
// ignore: comment_references
/// 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].options(skip: 'skip this'),
///   ],
///   (String word, int length) {
///     test('test word length',() {
///       expect(word.length, length);
///       });
///   },
/// );
/// ```
/// {@endtemplate}
@isTestGroup
ParameterizedTest get parameterizedGroup => const ParameterizedTestImpl(
      group,
      group,
      setUp,
      tearDown,
    );