fake_async
Fake asynchronous events such as timers and microtasks for deterministic testing.
1.3.3
7.1M downloads/mo
#86 most downloaded on pub.dev
dart-lang/test
What this package is like to depend on
Last release 2 years ago
no release in 18 months
Ships unpredictably
gaps range from 2 weeks to 2.3 years
Most releases are documented
notes for 9 of 11 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
16 releases · first in 2014
0 releases in the last 12 months
see the full history below
Release timeline
16 releases · Jul 2014 to Jan 2025Releases
latest 16-
1.3.328 Jan 2025Release notes
Open source →- Make the zone
create*TimerandscheduleMicrotaskbe responsible for running callbacks in the zone they're scheduled in, matching (new) standard zone behavior. (TheTimerconstructors and top-levelscheduleMicrotaskused to bind their callback, but now only registers it, leaving the zone to run in the correct zone and handle errors.) - Make periodic timers increment their
tickby more than one ifelapseBlockingadvanced time past multiple ticks.
- Make the zone
-
1.3.218 Oct 2024Release notes
Open source →- Require Dart 3.3
- Fix bug where a
flushTimersorelapsecall from within the callback of a periodic timer would immediately invoke the same timer. - Move to
dart-lang/testmonorepo.
-
1.3.115 Jun 2022 -
1.3.016 Mar 2022Release notes
Open source →FakeTimer.tickwill return a value instead of throwing.FakeAsync.includeTimerStackTraceallows controlling whether timers created with a FakeAsync will include a creation Stack Trace.
-
1.2.002 Feb 2021 -
1.2.0-nullsafety.303 Nov 2020 pre-releaseRelease notes
Open source →- Update SDK constraints to
>=2.12.0-0 <3.0.0based on beta release guidelines.
- Update SDK constraints to
-
1.2.0-nullsafety.223 Oct 2020 pre-release -
1.2.0-nullsafety.122 Sep 2020 pre-release -
1.2.0-nullsafety17 Aug 2020 pre-releaseRelease notes
Open source →Pre-release for the null safety migration of this package.
Note that
1.2.0may not be the final stable null safety release version, we reserve the right to release it as a2.0.0breaking change.This release will be pinned to only allow pre-release sdk versions starting from
2.10.0-0. -
1.1.006 Apr 2020Release notes
Open source →- Exposed the
FakeTimerclass as a public class. - Added
FakeAsync.pendingTimerswhich gives access to all pending timers at the time of the call.
- Exposed the
-
1.1.0-nullsafety29 Jul 2020 pre-releaseNothing published for this version
-
1.0.113 Jul 2018Release notes
Open source →- Update to lowercase Dart core library constants.
- Fix use of deprecated
isInstanceOfmatcher.
-
1.0.001 May 2018Release notes
Open source →This release contains the
FakeAsyncclass that was defined inquiver. It's backwards-compatible with both thequiverversion and the old version of thefake_asyncpackage.New Features
- A top-level
fakeAsync()function was added that encapsulatesnew FakeAsync().run(...).
New Features Relative to
quiver-
FakeAsync.elapsedreturns the total amount of fake time elapsed since theFakeAsyncinstance was created. -
new FakeAsync()now takes aninitialTimeargument that sets the default time for clocks created withFakeAsync.getClock(), and for theclockpackage's top-levelclockvariable.
New Features Relative to
fake_async0.1-
FakeAsync.periodicTimerCount,FakeAsync.nonPeriodicTimerCount, andFakeAsync.microtaskCountprovide visibility into the events scheduled withinFakeAsync.run(). -
FakeAsync.getClock()provides access to fully-featuredClockobjects based onFakeAsync's elapsed time. -
FakeAsync.flushMicrotasks()empties the microtask queue without elapsing any time or running any timers. -
FakeAsync.flushTimers()runs all microtasks and timers until there are no more scheduled.
- A top-level
-
0.1.207 Oct 2014 -
0.1.115 Sep 2014Nothing published for this version
-
0.1.021 Jul 2014Nothing published for this version