Skip to content

Commit

Permalink
Allow matcher for suiteJson path argument. Ignore case
Browse files Browse the repository at this point in the history
  • Loading branch information
natebosch committed Jun 15, 2023
1 parent 9dda9bb commit 90e4f67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkgs/test/test/runner/json_reporter_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ void customTest(String name, dynamic Function() testFn) => test(name, testFn);
useRelativePath: false,
[
[
suiteJson(0, path: path),
suiteJson(0, path: equalsIgnoringCase(path)),
testStartJson(
1, allOf(startsWith('loading '), endsWith('test.dart')),
groupIDs: []),
Expand Down
7 changes: 4 additions & 3 deletions pkgs/test/test/runner/json_reporter_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,16 @@ Map<String, Object> _allSuitesJson({int count = 1}) =>
/// Returns the event emitted by the JSON reporter indicating that a suite has
/// begun running.
///
/// The [platform] defaults to `"vm"`, the [path] defaults to `"test.dart"`.
/// The [platform] defaults to `'vm'`.
/// The [path] defaults to `equals('test.dart')`.
Map<String, Object> suiteJson(int id,
{String platform = 'vm', String path = 'test.dart'}) =>
{String platform = 'vm', Matcher? path}) =>
{
'type': 'suite',
'suite': {
'id': id,
'platform': platform,
'path': path,
'path': path ?? 'test.dart',
}
};

Expand Down

0 comments on commit 90e4f67

Please sign in to comment.