diff --git a/pkgs/test/test/runner/json_reporter_test.dart b/pkgs/test/test/runner/json_reporter_test.dart index d987a4b08..934d89a63 100644 --- a/pkgs/test/test/runner/json_reporter_test.dart +++ b/pkgs/test/test/runner/json_reporter_test.dart @@ -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: []), diff --git a/pkgs/test/test/runner/json_reporter_utils.dart b/pkgs/test/test/runner/json_reporter_utils.dart index ddb73b489..bbdbb78f0 100644 --- a/pkgs/test/test/runner/json_reporter_utils.dart +++ b/pkgs/test/test/runner/json_reporter_utils.dart @@ -61,15 +61,16 @@ Map _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 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', } };