Skip to content

React Native: Jest did not exit one second after the test run completed #1847

@flextremedev

Description

@flextremedev

Describe the bug
When testing react native code that uses react-query you'll get the following error:

Jest did not exit one second after the test run has completed.
This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with --detectOpenHandles to troubleshoot this issue.

To Reproduce
Steps to reproduce the behavior:

  1. Clone https://github.com/flextremedev/ReactNativePlayground
  2. Run "yarn"
  3. Run "yarn test react-query"
  4. See error

Expected behavior
I expected the test run to complete without leaving open handles.

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