Skip to content

Changes legacy timers to modern timers in Jest v27 #34

@voicis

Description

@voicis

It's impossible to use wait-for-expect and legacy fake timers with Jest v27.

If you set legacy timers in jest config https://jestjs.io/docs/configuration#timers-string, which enables legacy timers for all tests, however after you call waitForExpect it changes to modern timers and they will be used for the rest of the test.

I suspect that this is because the following code which now sets modern timers by default.

jest.useFakeTimers();

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