Skip to content

Allow fake timers other than jest #987

Open
@IanVS

Description

@IanVS

Describe the feature you'd like:

This is an follow-on to #939. The request is to support fake timers other than jest. For instance, jest uses @sinonjs/fake-timers under the hood, and yet it's not possible to use @sinonjs/fake-timers directly with testing-library without jest. I would like to be able to use testing-library with @sinonjs/fake-timers without jest.

Suggested implementation:

@eps1lon had a good suggestion in #939 (comment) to decouple testing-library from jest timers, and @MatanBobi suggested doing so in a way that can be set up in the configure step instead of requiring wrappers.

Describe alternatives you've considered:

I have tried to manually advance the clock with clock.tick(), and it works but causes act warnings.

Teachability, Documentation, Adoption, Migration Strategy:

I'm not certain what, if anything, will need to be done in user land to make this work. Ideally, it could be handled under-the-hood within this library, but I'm not sure how that could be done in a robust way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions