Skip to content

Commit

Permalink
Bump lints, require Dart 3.3, test wasm on dev channel (dart-lang/fak…
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmoo authored Feb 20, 2024
1 parent 2f366fa commit 120f8ed
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 16 deletions.
7 changes: 5 additions & 2 deletions pkgs/fake_async/.github/workflows/test-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
2 changes: 1 addition & 1 deletion pkgs/fake_async/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## 1.3.2-wip

* Require Dart 3.0.0
* Require Dart 3.3

## 1.3.1

Expand Down
4 changes: 2 additions & 2 deletions pkgs/fake_async/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ description: >-
repository: https://github.com/dart-lang/fake_async

environment:
sdk: ^3.0.0
sdk: ^3.3.0

dependencies:
clock: ^1.1.0
collection: ^1.15.0

dev_dependencies:
async: ^2.5.0
dart_flutter_team_lints: ^1.0.0
dart_flutter_team_lints: ^2.0.0
test: ^1.16.0
22 changes: 11 additions & 11 deletions pkgs/fake_async/test/fake_async_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <String>[];
Timer(elapseBy ~/ 2, () => log.add('1'));
Timer(elapseBy ~/ 2, () => log.add('2'));
async.elapse(elapseBy);
Expand All @@ -131,7 +131,7 @@ void main() {

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

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

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

final events = <int>[];
final errors = [];
final errors = <Object>[];
timed.listen(events.add, onError: errors.add);

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

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

test('should not run timers', () {
FakeAsync().run((async) {
final log = [];
final log = <int>[];
scheduleMicrotask(() => log.add(1));
Timer.run(() => log.add(2));
Timer.periodic(const Duration(seconds: 1), (_) => log.add(2));
Expand All @@ -338,7 +338,7 @@ void main() {
group('flushTimers', () {
test('should flush timers in FIFO order', () {
FakeAsync().run((async) {
final log = [];
final log = <int>[];
Timer.run(() {
log.add(1);
Timer(elapseBy, () => log.add(3));
Expand All @@ -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 = <String>[];
Timer(const Duration(seconds: 2), () => log.add('delayed'));
Timer.periodic(const Duration(seconds: 1), (_) => log.add('periodic'));

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

Expand Down Expand Up @@ -574,7 +574,7 @@ void main() {

test('should increment tick in a periodic timer', () {
return FakeAsync().run((async) {
final ticks = [];
final ticks = <int>[];
Timer.periodic(
elapseBy,
expectAsync1((timer) {
Expand Down

0 comments on commit 120f8ed

Please sign in to comment.