Skip to content

Jest Tests complain about async tasks cleanup not present  #1

@michaelryancaputo

Description

@michaelryancaputo

Hi! I found your article on upmostly. I found it very useful, however I'm trying to write a Jest test for this module using the react-testing-library. It seems like there is something that is not being cancelled. The error is this:

Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.

I think it's complaining about the fetchMoreListItems function not being cancelable.

Any thoughts on this?

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