From 120f8edf0ddfc4ee551dcd3f17a1c7e31fd9be7e Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Tue, 20 Feb 2024 12:54:47 -0800 Subject: [PATCH] Bump lints, require Dart 3.3, test wasm on dev channel (dart-lang/fake_async#77) --- .../.github/workflows/test-package.yml | 7 ++++-- pkgs/fake_async/CHANGELOG.md | 2 +- pkgs/fake_async/pubspec.yaml | 4 ++-- pkgs/fake_async/test/fake_async_test.dart | 22 +++++++++---------- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/pkgs/fake_async/.github/workflows/test-package.yml b/pkgs/fake_async/.github/workflows/test-package.yml index 4e4e97d8..7ff41465 100644 --- a/pkgs/fake_async/.github/workflows/test-package.yml +++ b/pkgs/fake_async/.github/workflows/test-package.yml @@ -47,7 +47,7 @@ jobs: matrix: # Add macos-latest and/or windows-latest if relevant for this package. os: [ubuntu-latest] - sdk: [3.0.0, dev] + sdk: [3.3, dev] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3 @@ -59,6 +59,9 @@ jobs: - name: Run VM tests run: dart test --platform vm if: always() && steps.install.outcome == 'success' - - name: Run Chrome tests + - name: Run Chrome tests - js run: dart test --platform chrome if: always() && steps.install.outcome == 'success' + - name: Run Chrome tests - wasm + run: dart test --platform chrome --compiler dart2wasm + if: always() && steps.install.outcome == 'success' && matrix.sdk == 'dev' diff --git a/pkgs/fake_async/CHANGELOG.md b/pkgs/fake_async/CHANGELOG.md index 7e998ab6..61c8b85e 100644 --- a/pkgs/fake_async/CHANGELOG.md +++ b/pkgs/fake_async/CHANGELOG.md @@ -1,6 +1,6 @@ ## 1.3.2-wip -* Require Dart 3.0.0 +* Require Dart 3.3 ## 1.3.1 diff --git a/pkgs/fake_async/pubspec.yaml b/pkgs/fake_async/pubspec.yaml index 51cc1536..191139f8 100644 --- a/pkgs/fake_async/pubspec.yaml +++ b/pkgs/fake_async/pubspec.yaml @@ -6,7 +6,7 @@ description: >- repository: https://github.com/dart-lang/fake_async environment: - sdk: ^3.0.0 + sdk: ^3.3.0 dependencies: clock: ^1.1.0 @@ -14,5 +14,5 @@ dependencies: dev_dependencies: async: ^2.5.0 - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 test: ^1.16.0 diff --git a/pkgs/fake_async/test/fake_async_test.dart b/pkgs/fake_async/test/fake_async_test.dart index e0d78bb3..7aefc5fe 100644 --- a/pkgs/fake_async/test/fake_async_test.dart +++ b/pkgs/fake_async/test/fake_async_test.dart @@ -121,7 +121,7 @@ void main() { test('should call timers occurring at the same time in FIFO order', () { FakeAsync().run((async) { - final log = []; + final log = []; Timer(elapseBy ~/ 2, () => log.add('1')); Timer(elapseBy ~/ 2, () => log.add('2')); async.elapse(elapseBy); @@ -131,7 +131,7 @@ void main() { test('should maintain FIFO order even with periodic timers', () { FakeAsync().run((async) { - final log = []; + final log = []; Timer.periodic(elapseBy ~/ 2, (_) => log.add('periodic 1')); Timer(elapseBy ~/ 2, () => log.add('delayed 1')); Timer(elapseBy, () => log.add('delayed 2')); @@ -191,7 +191,7 @@ void main() { test('should add event before advancing time', () { FakeAsync().run((async) { - final controller = StreamController(); + final controller = StreamController(); expect(controller.stream.first.then((_) { expect(async.elapsed, Duration.zero); }), completes); @@ -259,7 +259,7 @@ void main() { test('should work with Future.timeout', () { FakeAsync().run((async) { - final completer = Completer(); + final completer = Completer(); expect(completer.future.timeout(elapseBy ~/ 2), throwsA(const TypeMatcher())); async.elapse(elapseBy); @@ -285,7 +285,7 @@ void main() { final timed = controller.stream.timeout(const Duration(minutes: 2)); final events = []; - final errors = []; + final errors = []; timed.listen(events.add, onError: errors.add); controller.add(0); @@ -310,7 +310,7 @@ void main() { test('should flush microtasks scheduled by microtasks in order', () { FakeAsync().run((async) { - final log = []; + final log = []; scheduleMicrotask(() { log.add(1); scheduleMicrotask(() => log.add(3)); @@ -324,7 +324,7 @@ void main() { test('should not run timers', () { FakeAsync().run((async) { - final log = []; + final log = []; scheduleMicrotask(() => log.add(1)); Timer.run(() => log.add(2)); Timer.periodic(const Duration(seconds: 1), (_) => log.add(2)); @@ -338,7 +338,7 @@ void main() { group('flushTimers', () { test('should flush timers in FIFO order', () { FakeAsync().run((async) { - final log = []; + final log = []; Timer.run(() { log.add(1); Timer(elapseBy, () => log.add(3)); @@ -355,7 +355,7 @@ void main() { 'should run collateral periodic timers with non-periodic first if ' 'scheduled first', () { FakeAsync().run((async) { - final log = []; + final log = []; Timer(const Duration(seconds: 2), () => log.add('delayed')); Timer.periodic(const Duration(seconds: 1), (_) => log.add('periodic')); @@ -368,7 +368,7 @@ void main() { 'should run collateral periodic timers with periodic first ' 'if scheduled first', () { FakeAsync().run((async) { - final log = []; + final log = []; Timer.periodic(const Duration(seconds: 1), (_) => log.add('periodic')); Timer(const Duration(seconds: 2), () => log.add('delayed')); @@ -574,7 +574,7 @@ void main() { test('should increment tick in a periodic timer', () { return FakeAsync().run((async) { - final ticks = []; + final ticks = []; Timer.periodic( elapseBy, expectAsync1((timer) {