Skip to content

test: Leaking test #884

Closed
Closed
@ph-fritsche

Description

@ph-fritsche
  • @testing-library/dom version: master = v7.29.4

Relevant code or config:

This test leaks setTimeout so that tests added below are not run by jest.

test('should not use realTimers when timers are not faked with useFakeTimers', () => {

What you did:

Added tests for a pull request.

What happened:

Jest fails to setTimeout for subsequent tests.
Adding a describe block with test, the tests are ignored without error messages.
Adding a describe block with test.only reveals the problem.

Suggested solution:

Enclose the tests in a describe block and define beforeAll/afterEach to properly clean up after the test.

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