Skip to content

Use clock package in _TimeIntervalStreamSink (and maybe others)Β #660

@nightscape

Description

@nightscape

In order to deterministically test async code, the fakeAsync package currently seems to be the way to go.
Unfortunately, it cannot modify the StopWatch from dart:core, and instead it is recommended to use the clock package which describes itself as

This package provides a Clock class which encapsulates the notion of the "current time" and provides easy access to points relative to the current time. Different Clocks can have a different notion of the current time, and the default top-level clock's notion can be swapped out to reliably test timing-dependent code.

Would it be possible to use this package in _TimeIntervalStreamSink and possibly other places, in order to allow deterministic testing using fakeAsync?

I'd be happy to contribute a corresponding PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions