fake_async 1.0.0
fake_async: ^1.0.0 copied to clipboard
Fake asynchronous events such as timers and microtasks for deterministic testing.
1.0.0 #
This release contains the FakeAsync class that was defined in quiver.
It's backwards-compatible with both the quiver version and the old version
of the fake_async package.
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_async 0.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.
0.1.2 #
- Integrate with the clock package.