dart-lang / fake_async

Fake asynchronous events for deterministic testing.
https://pub.dev/packages/fake_async
Apache License 2.0
90 stars 16 forks source link

Add FakeAsync.runNextTimer #85

Open gnprice opened 3 months ago

gnprice commented 3 months ago

Fixes #84.

This method is like flushTimers, but runs just one timer and then returns. That allows the caller to write their own loop similar to flushTimers but with custom logic of their own.


Contribution guidelines:
- See our [contributor guide](https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md) for general expectations for PRs. - Larger or significant changes should be discussed in an issue before creating a PR. - Contributions to our repos should follow the [Dart style guide](https://dart.dev/guides/language/effective-dart) and use `dart format`. - Most changes should add an entry to the changelog and may need to [rev the pubspec package version](https://github.com/dart-lang/sdk/blob/main/docs/External-Package-Maintenance.md#making-a-change). - Changes to packages require [corresponding tests](https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md#Testing). Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.
natebosch commented 2 months ago

I think this looks like a sensible API. I'll double check this doesn't impact existing internal usage. @lrhn any concerns?

natebosch commented 2 months ago

No impact to internal usage, so this is safe to land after review.