Skip to content

Allow controlling Timekeeper in tests for sendAfter #689

@bhamiltoncx

Description

@bhamiltoncx

Currently, Timekeeper only supports physical wall-clock time (it uses Date.now() and setInterval()), and there's no way to provide a fake version in tests.

Ideally, we'd have some way to provide the current time from outside in a test (Date.now()) as well as a way to control when callbacks passed to setInterval() fire.

Jest provides timer mocks which can help, but they require knowing the implementation of Timekeeper in order to function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions