Skip to content

Commit 120f8ed

Browse files
authored
Bump lints, require Dart 3.3, test wasm on dev channel (dart-archive/fake_async#77)
1 parent 2f366fa commit 120f8ed

File tree

4 files changed

+19
-16
lines changed

4 files changed

+19
-16
lines changed

pkgs/fake_async/.github/workflows/test-package.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
matrix:
4848
# Add macos-latest and/or windows-latest if relevant for this package.
4949
os: [ubuntu-latest]
50-
sdk: [3.0.0, dev]
50+
sdk: [3.3, dev]
5151
steps:
5252
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
5353
- uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3
@@ -59,6 +59,9 @@ jobs:
5959
- name: Run VM tests
6060
run: dart test --platform vm
6161
if: always() && steps.install.outcome == 'success'
62-
- name: Run Chrome tests
62+
- name: Run Chrome tests - js
6363
run: dart test --platform chrome
6464
if: always() && steps.install.outcome == 'success'
65+
- name: Run Chrome tests - wasm
66+
run: dart test --platform chrome --compiler dart2wasm
67+
if: always() && steps.install.outcome == 'success' && matrix.sdk == 'dev'

pkgs/fake_async/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## 1.3.2-wip
22

3-
* Require Dart 3.0.0
3+
* Require Dart 3.3
44

55
## 1.3.1
66

pkgs/fake_async/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ description: >-
66
repository: https://github.com/dart-lang/fake_async
77

88
environment:
9-
sdk: ^3.0.0
9+
sdk: ^3.3.0
1010

1111
dependencies:
1212
clock: ^1.1.0
1313
collection: ^1.15.0
1414

1515
dev_dependencies:
1616
async: ^2.5.0
17-
dart_flutter_team_lints: ^1.0.0
17+
dart_flutter_team_lints: ^2.0.0
1818
test: ^1.16.0

pkgs/fake_async/test/fake_async_test.dart

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ void main() {
121121

122122
test('should call timers occurring at the same time in FIFO order', () {
123123
FakeAsync().run((async) {
124-
final log = [];
124+
final log = <String>[];
125125
Timer(elapseBy ~/ 2, () => log.add('1'));
126126
Timer(elapseBy ~/ 2, () => log.add('2'));
127127
async.elapse(elapseBy);
@@ -131,7 +131,7 @@ void main() {
131131

132132
test('should maintain FIFO order even with periodic timers', () {
133133
FakeAsync().run((async) {
134-
final log = [];
134+
final log = <String>[];
135135
Timer.periodic(elapseBy ~/ 2, (_) => log.add('periodic 1'));
136136
Timer(elapseBy ~/ 2, () => log.add('delayed 1'));
137137
Timer(elapseBy, () => log.add('delayed 2'));
@@ -191,7 +191,7 @@ void main() {
191191

192192
test('should add event before advancing time', () {
193193
FakeAsync().run((async) {
194-
final controller = StreamController();
194+
final controller = StreamController<void>();
195195
expect(controller.stream.first.then((_) {
196196
expect(async.elapsed, Duration.zero);
197197
}), completes);
@@ -259,7 +259,7 @@ void main() {
259259

260260
test('should work with Future.timeout', () {
261261
FakeAsync().run((async) {
262-
final completer = Completer();
262+
final completer = Completer<void>();
263263
expect(completer.future.timeout(elapseBy ~/ 2),
264264
throwsA(const TypeMatcher<TimeoutException>()));
265265
async.elapse(elapseBy);
@@ -285,7 +285,7 @@ void main() {
285285
final timed = controller.stream.timeout(const Duration(minutes: 2));
286286

287287
final events = <int>[];
288-
final errors = [];
288+
final errors = <Object>[];
289289
timed.listen(events.add, onError: errors.add);
290290

291291
controller.add(0);
@@ -310,7 +310,7 @@ void main() {
310310

311311
test('should flush microtasks scheduled by microtasks in order', () {
312312
FakeAsync().run((async) {
313-
final log = [];
313+
final log = <int>[];
314314
scheduleMicrotask(() {
315315
log.add(1);
316316
scheduleMicrotask(() => log.add(3));
@@ -324,7 +324,7 @@ void main() {
324324

325325
test('should not run timers', () {
326326
FakeAsync().run((async) {
327-
final log = [];
327+
final log = <int>[];
328328
scheduleMicrotask(() => log.add(1));
329329
Timer.run(() => log.add(2));
330330
Timer.periodic(const Duration(seconds: 1), (_) => log.add(2));
@@ -338,7 +338,7 @@ void main() {
338338
group('flushTimers', () {
339339
test('should flush timers in FIFO order', () {
340340
FakeAsync().run((async) {
341-
final log = [];
341+
final log = <int>[];
342342
Timer.run(() {
343343
log.add(1);
344344
Timer(elapseBy, () => log.add(3));
@@ -355,7 +355,7 @@ void main() {
355355
'should run collateral periodic timers with non-periodic first if '
356356
'scheduled first', () {
357357
FakeAsync().run((async) {
358-
final log = [];
358+
final log = <String>[];
359359
Timer(const Duration(seconds: 2), () => log.add('delayed'));
360360
Timer.periodic(const Duration(seconds: 1), (_) => log.add('periodic'));
361361

@@ -368,7 +368,7 @@ void main() {
368368
'should run collateral periodic timers with periodic first '
369369
'if scheduled first', () {
370370
FakeAsync().run((async) {
371-
final log = [];
371+
final log = <String>[];
372372
Timer.periodic(const Duration(seconds: 1), (_) => log.add('periodic'));
373373
Timer(const Duration(seconds: 2), () => log.add('delayed'));
374374

@@ -574,7 +574,7 @@ void main() {
574574

575575
test('should increment tick in a periodic timer', () {
576576
return FakeAsync().run((async) {
577-
final ticks = [];
577+
final ticks = <int>[];
578578
Timer.periodic(
579579
elapseBy,
580580
expectAsync1((timer) {

0 commit comments

Comments
 (0)