Skip to content

Using jest's fake timers completely freezes test execution #83

@alucryd

Description

@alucryd

Using fake timers in multiple tests freezes the execution, with no other option but to kill the process.

import dayjs from "dayjs";

const now = dayjs();

beforeEach(async () => {
  jest.useFakeTimers().setSystemTime(now.toDate());
})

afterEach(async () => {
  jest.useRealTimers();
})

Calling jest.useRealTimers(); in afterEach as suggested here doesn't help unfortunately. Sorry I took so long go get back to creating a dedicated issue.

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