From 96ed242c6d64f02d206359d681b9f9995d5aa798 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Wed, 10 May 2023 00:24:08 +0000 Subject: [PATCH 01/10] Add error for empty groups Closes #1961 After declaring a group check for declared tests, if there were none add a synthetic test that fails with an error about the empty group. --- pkgs/test/CHANGELOG.md | 1 + pkgs/test_api/CHANGELOG.md | 1 + pkgs/test_api/lib/src/backend/declarer.dart | 6 ++++++ pkgs/test_api/test/backend/declarer_test.dart | 11 +++++++++++ pkgs/test_core/CHANGELOG.md | 1 + 5 files changed, 20 insertions(+) diff --git a/pkgs/test/CHANGELOG.md b/pkgs/test/CHANGELOG.md index 8c0254eca..5038c6fcf 100644 --- a/pkgs/test/CHANGELOG.md +++ b/pkgs/test/CHANGELOG.md @@ -1,6 +1,7 @@ ## 1.24.3-wip * Fix compatibility with wasm number semantics. +* Consider empty `group` to be test failures. ## 1.24.2 diff --git a/pkgs/test_api/CHANGELOG.md b/pkgs/test_api/CHANGELOG.md index 4d79f0a59..972cd189e 100644 --- a/pkgs/test_api/CHANGELOG.md +++ b/pkgs/test_api/CHANGELOG.md @@ -1,6 +1,7 @@ ## 0.5.3-wip * Fix compatibility with wasm number semantics. +* Consider empty `group` to be test failures. ## 0.5.2 diff --git a/pkgs/test_api/lib/src/backend/declarer.dart b/pkgs/test_api/lib/src/backend/declarer.dart index 7a37552c6..999e3be13 100644 --- a/pkgs/test_api/lib/src/backend/declarer.dart +++ b/pkgs/test_api/lib/src/backend/declarer.dart @@ -13,6 +13,7 @@ import 'group_entry.dart'; import 'invoker.dart'; import 'metadata.dart'; import 'test.dart'; +import 'test_failure.dart'; /// A class that manages the state of tests as they're declared. /// @@ -327,6 +328,11 @@ class Declarer { } return entry; }).toList(); + if (entries.isEmpty) { + entries.add(LocalTest(_name ?? 'Empty group', _metadata, () { + throw TestFailure('No tests declared in group'); + })); + } return Group(_name ?? '', entries, metadata: _metadata, diff --git a/pkgs/test_api/test/backend/declarer_test.dart b/pkgs/test_api/test/backend/declarer_test.dart index 0fe848a05..23e736d89 100644 --- a/pkgs/test_api/test/backend/declarer_test.dart +++ b/pkgs/test_api/test/backend/declarer_test.dart @@ -410,6 +410,17 @@ void main() { }); }); + test('disallows empty groups', () async { + var entries = declare(() { + group('group', () {}); + }); + + expect(entries, hasLength(1)); + var testGroup = entries.single as Group; + expect(testGroup.entries, hasLength(1)); + await _runTest(testGroup.entries.single as Test, shouldFail: true); + }); + group('.setUp()', () { test('is scoped to the group', () async { var setUpRun = false; diff --git a/pkgs/test_core/CHANGELOG.md b/pkgs/test_core/CHANGELOG.md index 2f6be0845..bc456b2d0 100644 --- a/pkgs/test_core/CHANGELOG.md +++ b/pkgs/test_core/CHANGELOG.md @@ -1,6 +1,7 @@ ## 0.5.3-wip * Fix compatibility with wasm number semantics. +* Consider empty `group` to be test failures. ## 0.5.2 From b8aabbb41200eb3a6f0a31ef08a999535d7a9a6b Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Thu, 11 May 2023 00:35:07 +0000 Subject: [PATCH 02/10] Add allowEmpty config for groups --- pkgs/test_api/lib/src/backend/declarer.dart | 7 ++++--- pkgs/test_api/test/backend/declarer_test.dart | 11 ++++++++++- pkgs/test_core/lib/scaffolding.dart | 2 ++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/pkgs/test_api/lib/src/backend/declarer.dart b/pkgs/test_api/lib/src/backend/declarer.dart index 999e3be13..0e6a63522 100644 --- a/pkgs/test_api/lib/src/backend/declarer.dart +++ b/pkgs/test_api/lib/src/backend/declarer.dart @@ -233,6 +233,7 @@ class Declarer { Map? onPlatform, tags, int? retry, + bool allowEmpty = false, bool solo = false}) { _checkNotBuilt('group'); @@ -269,7 +270,7 @@ class Declarer { if (result is! Future) return; throw ArgumentError('Groups may not be async.'); }); - _addEntry(declarer.build()); + _addEntry(declarer.build(allowEmpty)); if (solo || declarer._solo) { _soloEntries.add(_entries.last); @@ -314,7 +315,7 @@ class Declarer { /// /// **Note**: The tests in this group must be run in a [Invoker.guard] /// context; otherwise, test errors won't be captured. - Group build() { + Group build([bool allowEmpty = false]) { _checkNotBuilt('build'); _built = true; @@ -328,7 +329,7 @@ class Declarer { } return entry; }).toList(); - if (entries.isEmpty) { + if (!allowEmpty && entries.isEmpty) { entries.add(LocalTest(_name ?? 'Empty group', _metadata, () { throw TestFailure('No tests declared in group'); })); diff --git a/pkgs/test_api/test/backend/declarer_test.dart b/pkgs/test_api/test/backend/declarer_test.dart index 23e736d89..7c25ae39c 100644 --- a/pkgs/test_api/test/backend/declarer_test.dart +++ b/pkgs/test_api/test/backend/declarer_test.dart @@ -410,7 +410,7 @@ void main() { }); }); - test('disallows empty groups', () async { + test('disallows empty groups by default', () async { var entries = declare(() { group('group', () {}); }); @@ -420,6 +420,15 @@ void main() { expect(testGroup.entries, hasLength(1)); await _runTest(testGroup.entries.single as Test, shouldFail: true); }); + test('allows empty groups when requested', () async { + var entries = declare(() { + group('group', () {}, allowEmpty: true); + }); + + expect(entries, hasLength(1)); + var testGroup = entries.single as Group; + expect(testGroup.entries, hasLength(0)); + }); group('.setUp()', () { test('is scoped to the group', () async { diff --git a/pkgs/test_core/lib/scaffolding.dart b/pkgs/test_core/lib/scaffolding.dart index ab1ec5985..89028c7dc 100644 --- a/pkgs/test_core/lib/scaffolding.dart +++ b/pkgs/test_core/lib/scaffolding.dart @@ -218,6 +218,7 @@ void group(description, dynamic Function() body, tags, Map? onPlatform, int? retry, + bool allowEmpty = false, @Deprecated('Debug only') bool solo = false}) { _declarer.group(description.toString(), body, testOn: testOn, @@ -226,6 +227,7 @@ void group(description, dynamic Function() body, tags: tags, onPlatform: onPlatform, retry: retry, + allowEmpty: allowEmpty, solo: solo); // Force dart2js not to inline this function. We need it to be separate from From 999cc83d1a9e1b4e5c40a1c309b210f9c3124402 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Sat, 13 May 2023 01:24:50 +0000 Subject: [PATCH 03/10] Don't report for empty top level group The output already has special behavior for when there are no tests at all, and the output is less clear when it's the root group which is empty since the root group has no name. Also refactor duplicate name tests to have different file content when testing identical group names to avoid empty groups in any case. --- .../configuration/duplicate_names_test.dart | 142 +++++++++++------- pkgs/test_api/lib/src/backend/declarer.dart | 2 +- 2 files changed, 86 insertions(+), 58 deletions(-) diff --git a/pkgs/test/test/runner/configuration/duplicate_names_test.dart b/pkgs/test/test/runner/configuration/duplicate_names_test.dart index d9afc44f2..a1ce7f4ca 100644 --- a/pkgs/test/test/runner/configuration/duplicate_names_test.dart +++ b/pkgs/test/test/runner/configuration/duplicate_names_test.dart @@ -16,65 +16,93 @@ void main() { group('duplicate names', () { group('can be disabled for', () { - for (var function in ['group', 'test']) { - test('${function}s', () async { - await d - .file('dart_test.yaml', - jsonEncode({'allow_duplicate_test_names': false})) - .create(); - - var testName = 'test'; - await d.file('test.dart', ''' - import 'package:test/test.dart'; - - void main() { - $function("$testName", () {}); - $function("$testName", () {}); - } - ''').create(); - - var test = await runTest([ - 'test.dart', - '--configuration', - p.join(d.sandbox, 'dart_test.yaml') - ]); - - expect( - test.stdout, - emitsThrough(contains( - 'A test with the name "$testName" was already declared.'))); - - await test.shouldExit(1); - }); - } + test('groups', () async { + await d + .file('dart_test.yaml', + jsonEncode({'allow_duplicate_test_names': false})) + .create(); + + await d.file('test.dart', _identicalGroupnames).create(); + + var test = await runTest([ + 'test.dart', + '--configuration', + p.join(d.sandbox, 'dart_test.yaml') + ]); + + expect( + test.stdout, + emitsThrough(contains( + 'A test with the name "identical name" was already declared.'))); + + await test.shouldExit(1); + }); + test('tests', () async { + await d + .file('dart_test.yaml', + jsonEncode({'allow_duplicate_test_names': false})) + .create(); + + await d.file('test.dart', _identicalTestNames).create(); + + var test = await runTest([ + 'test.dart', + '--configuration', + p.join(d.sandbox, 'dart_test.yaml') + ]); + + expect( + test.stdout, + emitsThrough(contains( + 'A test with the name "identical name" was already declared.'))); + + await test.shouldExit(1); + }); }); group('are allowed by default for', () { - for (var function in ['group', 'test']) { - test('${function}s', () async { - var testName = 'test'; - await d.file('test.dart', ''' - import 'package:test/test.dart'; - - void main() { - $function("$testName", () {}); - $function("$testName", () {}); - - // Needed so at least one test runs when testing groups. - test('a test', () { - expect(true, isTrue); - }); - } - ''').create(); - - var test = await runTest( - ['test.dart'], - ); - - expect(test.stdout, emitsThrough(contains('All tests passed!'))); - - await test.shouldExit(0); - }); - } + test('groups', () async { + await d.file('test.dart', _identicalGroupnames).create(); + + var test = await runTest( + ['test.dart'], + ); + + expect(test.stdout, emitsThrough(contains('All tests passed!'))); + + await test.shouldExit(0); + }); + test('tests', () async { + await d.file('test.dart', _identicalTestNames).create(); + + var test = await runTest( + ['test.dart'], + ); + + expect(test.stdout, emitsThrough(contains('All tests passed!'))); + + await test.shouldExit(0); + }); }); }); } + +const _identicalTestNames = ''' +import 'package:test/test.dart'; + +void main() { + test('identical name', () {}); + test('identical name', () {}); +} +'''; +const _identicalGroupnames = ''' +import 'package:test/test.dart'; + +void main() { + group('identical name', () { + test('foo', () {}); + }); + group('identical name', () { + test('bar', () {}); + }); +} +'''; diff --git a/pkgs/test_api/lib/src/backend/declarer.dart b/pkgs/test_api/lib/src/backend/declarer.dart index 0e6a63522..e7c4b2302 100644 --- a/pkgs/test_api/lib/src/backend/declarer.dart +++ b/pkgs/test_api/lib/src/backend/declarer.dart @@ -329,7 +329,7 @@ class Declarer { } return entry; }).toList(); - if (!allowEmpty && entries.isEmpty) { + if (_parent != null && !allowEmpty && entries.isEmpty) { entries.add(LocalTest(_name ?? 'Empty group', _metadata, () { throw TestFailure('No tests declared in group'); })); From 70f8a338679d4359e23dcecf9921a2e37de91bab Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Tue, 16 May 2023 23:01:21 +0000 Subject: [PATCH 04/10] Adjust versions --- pkgs/test/CHANGELOG.md | 5 ++++- pkgs/test/pubspec.yaml | 6 +++--- pkgs/test_api/CHANGELOG.md | 5 ++++- pkgs/test_api/pubspec.yaml | 2 +- pkgs/test_core/CHANGELOG.md | 5 ++++- pkgs/test_core/pubspec.yaml | 4 ++-- 6 files changed, 18 insertions(+), 9 deletions(-) diff --git a/pkgs/test/CHANGELOG.md b/pkgs/test/CHANGELOG.md index 1a12ea0de..7ce3519bd 100644 --- a/pkgs/test/CHANGELOG.md +++ b/pkgs/test/CHANGELOG.md @@ -1,7 +1,10 @@ +## 1.24.4-wip + +* Consider empty `group` to be test failures. + ## 1.24.3 * Fix compatibility with wasm number semantics. -* Consider empty `group` to be test failures. ## 1.24.2 diff --git a/pkgs/test/pubspec.yaml b/pkgs/test/pubspec.yaml index 8877dab81..52ccbbd3d 100644 --- a/pkgs/test/pubspec.yaml +++ b/pkgs/test/pubspec.yaml @@ -1,5 +1,5 @@ name: test -version: 1.24.3 +version: 1.24.4-dev description: >- A full featured library for writing and running Dart tests across platforms. repository: https://github.com/dart-lang/test/tree/master/pkgs/test @@ -32,8 +32,8 @@ dependencies: webkit_inspection_protocol: ^1.0.0 yaml: ^3.0.0 # Use an exact version until the test_api and test_core package are stable. - test_api: 0.6.0 - test_core: 0.5.3 + test_api: 0.6.1 + test_core: 0.5.4 # Use a tight version constraint to ensure that a constraint on matcher # properly constrains all features it provides. matcher: '>=0.12.16 <0.12.17' diff --git a/pkgs/test_api/CHANGELOG.md b/pkgs/test_api/CHANGELOG.md index 140d8726f..5c29be35a 100644 --- a/pkgs/test_api/CHANGELOG.md +++ b/pkgs/test_api/CHANGELOG.md @@ -1,9 +1,12 @@ +## 0.6.1-wip + +* Consider empty `group` to be test failures. + ## 0.6.0 * Remove the `package:test_api/expect.dart' library. `test` will export from `package:matcher` directly. * Fix compatibility with wasm number semantics. -* Consider empty `group` to be test failures. ## 0.5.2 diff --git a/pkgs/test_api/pubspec.yaml b/pkgs/test_api/pubspec.yaml index 0db66a563..38901b969 100644 --- a/pkgs/test_api/pubspec.yaml +++ b/pkgs/test_api/pubspec.yaml @@ -1,5 +1,5 @@ name: test_api -version: 0.6.0 +version: 0.6.1-wip description: >- The user facing API for structuring Dart tests and checking expectations. repository: https://github.com/dart-lang/test/tree/master/pkgs/test_api diff --git a/pkgs/test_core/CHANGELOG.md b/pkgs/test_core/CHANGELOG.md index f5d0c7e2f..9d2dc041c 100644 --- a/pkgs/test_core/CHANGELOG.md +++ b/pkgs/test_core/CHANGELOG.md @@ -1,7 +1,10 @@ +## 0.5.4-wip + +* Consider empty `group` to be test failures. + ## 0.5.3 * Fix compatibility with wasm number semantics. -* Consider empty `group` to be test failures. ## 0.5.2 diff --git a/pkgs/test_core/pubspec.yaml b/pkgs/test_core/pubspec.yaml index 12b896f76..a097f5287 100644 --- a/pkgs/test_core/pubspec.yaml +++ b/pkgs/test_core/pubspec.yaml @@ -1,5 +1,5 @@ name: test_core -version: 0.5.3 +version: 0.5.4-wip description: A basic library for writing tests and running them on the VM. repository: https://github.com/dart-lang/test/tree/master/pkgs/test_core @@ -28,7 +28,7 @@ dependencies: vm_service: ">=6.0.0 <12.0.0" yaml: ^3.0.0 # Use an exact version until the test_api package is stable. - test_api: 0.6.0 + test_api: 0.6.1 dev_dependencies: lints: '>=1.0.0 <3.0.0' From 8d9cacc9a09c2e88d4214a8063f62e6c5cc51d80 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Tue, 16 May 2023 23:03:24 +0000 Subject: [PATCH 05/10] wip not dev --- pkgs/test/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/test/pubspec.yaml b/pkgs/test/pubspec.yaml index 52ccbbd3d..774770d77 100644 --- a/pkgs/test/pubspec.yaml +++ b/pkgs/test/pubspec.yaml @@ -1,5 +1,5 @@ name: test -version: 1.24.4-dev +version: 1.24.4-wip description: >- A full featured library for writing and running Dart tests across platforms. repository: https://github.com/dart-lang/test/tree/master/pkgs/test From bf113bd4c155e73fd1f456d3b8a4c47725358960 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Thu, 5 Oct 2023 23:51:49 +0000 Subject: [PATCH 06/10] Fix bad merge --- pkgs/test/pubspec.yaml | 9 --------- pkgs/test_core/pubspec.yaml | 3 --- 2 files changed, 12 deletions(-) diff --git a/pkgs/test/pubspec.yaml b/pkgs/test/pubspec.yaml index 0ddde186e..4a5661a39 100644 --- a/pkgs/test/pubspec.yaml +++ b/pkgs/test/pubspec.yaml @@ -41,15 +41,6 @@ dependencies: web_socket_channel: ^2.0.0 webkit_inspection_protocol: ^1.0.0 yaml: ^3.0.0 -<<<<<<< HEAD - # Use an exact version until the test_api and test_core package are stable. - test_api: 0.6.1 - test_core: 0.5.4 - # Use a tight version constraint to ensure that a constraint on matcher - # properly constrains all features it provides. - matcher: '>=0.12.16 <0.12.17' -======= ->>>>>>> master dev_dependencies: dart_flutter_team_lints: ^1.0.0 diff --git a/pkgs/test_core/pubspec.yaml b/pkgs/test_core/pubspec.yaml index 7aca0d40e..3b818121b 100644 --- a/pkgs/test_core/pubspec.yaml +++ b/pkgs/test_core/pubspec.yaml @@ -27,11 +27,8 @@ dependencies: stream_channel: ^2.1.0 # Use an exact version until the test_api package is stable. test_api: 0.6.1 -<<<<<<< HEAD -======= vm_service: ">=6.0.0 <13.0.0" yaml: ^3.0.0 ->>>>>>> master dev_dependencies: dart_flutter_team_lints: ^1.0.0 From 4fbfe5e5a38efef52d59707d75069b16a756be6b Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Wed, 11 Oct 2023 18:29:29 +0000 Subject: [PATCH 07/10] Drop allowEmpty, Allow fully empty groups --- pkgs/test/CHANGELOG.md | 3 ++- pkgs/test_api/CHANGELOG.md | 3 ++- pkgs/test_api/lib/src/backend/declarer.dart | 12 ++++++++---- pkgs/test_api/test/backend/declarer_test.dart | 13 +++++++++---- pkgs/test_core/CHANGELOG.md | 3 ++- pkgs/test_core/lib/scaffolding.dart | 2 -- 6 files changed, 23 insertions(+), 13 deletions(-) diff --git a/pkgs/test/CHANGELOG.md b/pkgs/test/CHANGELOG.md index 95c5f5f14..dae58bc7e 100644 --- a/pkgs/test/CHANGELOG.md +++ b/pkgs/test/CHANGELOG.md @@ -1,6 +1,7 @@ ## 1.24.8-wip -* Consider empty `group` to be test failures. +* Consider `group` with no test cases, but with another callback such as + `setUp`, to be test failures. ## 1.24.7 diff --git a/pkgs/test_api/CHANGELOG.md b/pkgs/test_api/CHANGELOG.md index 3db1a09f4..646de43a9 100644 --- a/pkgs/test_api/CHANGELOG.md +++ b/pkgs/test_api/CHANGELOG.md @@ -1,6 +1,7 @@ ## 0.6.2-wip -* Consider empty `group` to be test failures. +* Consider `group` with no test cases, but with another callback such as + `setUp`, to be test failures. ## 0.6.1 diff --git a/pkgs/test_api/lib/src/backend/declarer.dart b/pkgs/test_api/lib/src/backend/declarer.dart index 907b7237d..d7befbae6 100644 --- a/pkgs/test_api/lib/src/backend/declarer.dart +++ b/pkgs/test_api/lib/src/backend/declarer.dart @@ -233,7 +233,6 @@ class Declarer { Map? onPlatform, Object? tags, int? retry, - bool allowEmpty = false, bool solo = false}) { _checkNotBuilt('group'); @@ -270,7 +269,7 @@ class Declarer { if (result is! Future) return; throw ArgumentError('Groups may not be async.'); }); - _addEntry(declarer.build(allowEmpty)); + _addEntry(declarer.build()); if (solo || declarer._solo) { _soloEntries.add(_entries.last); @@ -315,7 +314,7 @@ class Declarer { /// /// **Note**: The tests in this group must be run in a [Invoker.guard] /// context; otherwise, test errors won't be captured. - Group build([bool allowEmpty = false]) { + Group build() { _checkNotBuilt('build'); _built = true; @@ -329,7 +328,12 @@ class Declarer { } return entry; }).toList(); - if (_parent != null && !allowEmpty && entries.isEmpty) { + if (_parent != null && + entries.isEmpty && + (_setUps.isNotEmpty || + _setUpAlls.isNotEmpty || + _tearDowns.isNotEmpty || + _tearDownAlls.isNotEmpty)) { entries.add(LocalTest(_name ?? 'Empty group', _metadata, () { throw TestFailure('No tests declared in group'); })); diff --git a/pkgs/test_api/test/backend/declarer_test.dart b/pkgs/test_api/test/backend/declarer_test.dart index 7c25ae39c..243cb7d6b 100644 --- a/pkgs/test_api/test/backend/declarer_test.dart +++ b/pkgs/test_api/test/backend/declarer_test.dart @@ -410,9 +410,12 @@ void main() { }); }); - test('disallows empty groups by default', () async { + test('disallows empty groups if there is another lifecycle callback', + () async { var entries = declare(() { - group('group', () {}); + group('group', () { + setUp(() {}); + }); }); expect(entries, hasLength(1)); @@ -420,9 +423,11 @@ void main() { expect(testGroup.entries, hasLength(1)); await _runTest(testGroup.entries.single as Test, shouldFail: true); }); - test('allows empty groups when requested', () async { + test('allows fully empty groups when requested', () async { var entries = declare(() { - group('group', () {}, allowEmpty: true); + group('group', () { + // Might be empty with a TODO or while editing + }); }); expect(entries, hasLength(1)); diff --git a/pkgs/test_core/CHANGELOG.md b/pkgs/test_core/CHANGELOG.md index 241c36155..e8b1a3a31 100644 --- a/pkgs/test_core/CHANGELOG.md +++ b/pkgs/test_core/CHANGELOG.md @@ -1,6 +1,7 @@ ## 0.5.8-wip -* Consider empty `group` to be test failures. +* Consider `group` with no test cases, but with another callback such as + `setUp`, to be test failures. ## 0.5.7 diff --git a/pkgs/test_core/lib/scaffolding.dart b/pkgs/test_core/lib/scaffolding.dart index 96695057d..b6719feb7 100644 --- a/pkgs/test_core/lib/scaffolding.dart +++ b/pkgs/test_core/lib/scaffolding.dart @@ -218,7 +218,6 @@ void group(Object? description, dynamic Function() body, Object? tags, Map? onPlatform, int? retry, - bool allowEmpty = false, @Deprecated('Debug only') bool solo = false}) { _declarer.group(description.toString(), body, testOn: testOn, @@ -227,7 +226,6 @@ void group(Object? description, dynamic Function() body, tags: tags, onPlatform: onPlatform, retry: retry, - allowEmpty: allowEmpty, solo: solo); // Force dart2js not to inline this function. We need it to be separate from From 63a7f3972fae29cb08b478b18b2c45f0edf535ed Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Wed, 11 Oct 2023 18:33:54 +0000 Subject: [PATCH 08/10] Feature bump in test --- pkgs/test/CHANGELOG.md | 2 +- pkgs/test/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/test/CHANGELOG.md b/pkgs/test/CHANGELOG.md index dae58bc7e..bb8be7470 100644 --- a/pkgs/test/CHANGELOG.md +++ b/pkgs/test/CHANGELOG.md @@ -1,4 +1,4 @@ -## 1.24.8-wip +## 1.25.0-wip * Consider `group` with no test cases, but with another callback such as `setUp`, to be test failures. diff --git a/pkgs/test/pubspec.yaml b/pkgs/test/pubspec.yaml index 4a5661a39..0a5de6eb0 100644 --- a/pkgs/test/pubspec.yaml +++ b/pkgs/test/pubspec.yaml @@ -1,5 +1,5 @@ name: test -version: 1.24.8-wip +version: 1.25.0-wip description: >- A full featured library for writing and running Dart tests across platforms. repository: https://github.com/dart-lang/test/tree/master/pkgs/test From e9ecaacee3c674411bc169a731f6e97f2b81b6bb Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Mon, 16 Oct 2023 19:22:46 +0000 Subject: [PATCH 09/10] Test tweaks --- pkgs/test_api/test/backend/declarer_test.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/test_api/test/backend/declarer_test.dart b/pkgs/test_api/test/backend/declarer_test.dart index 243cb7d6b..85020df35 100644 --- a/pkgs/test_api/test/backend/declarer_test.dart +++ b/pkgs/test_api/test/backend/declarer_test.dart @@ -423,7 +423,7 @@ void main() { expect(testGroup.entries, hasLength(1)); await _runTest(testGroup.entries.single as Test, shouldFail: true); }); - test('allows fully empty groups when requested', () async { + test('allows fully empty groups', () async { var entries = declare(() { group('group', () { // Might be empty with a TODO or while editing @@ -432,7 +432,7 @@ void main() { expect(entries, hasLength(1)); var testGroup = entries.single as Group; - expect(testGroup.entries, hasLength(0)); + expect(testGroup.entries, isEmpty); }); group('.setUp()', () { From 13df7e332cd9d78d971318e40e5f7ad06289e0ea Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Mon, 16 Oct 2023 19:23:20 +0000 Subject: [PATCH 10/10] fixup test_core constraint --- pkgs/test/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/test/pubspec.yaml b/pkgs/test/pubspec.yaml index c0b585375..0a16b3043 100644 --- a/pkgs/test/pubspec.yaml +++ b/pkgs/test/pubspec.yaml @@ -35,7 +35,7 @@ dependencies: # Use an exact version until the test_api and test_core package are stable. test_api: 0.6.1 - test_core: 0.5.8 + test_core: 0.5.9 typed_data: ^1.3.0 web_socket_channel: ^2.0.0