I want to cleanup react tree and abort all of it's asynchronous tasks. The react tree is rendered using render
function of React Testing Library. I know that you can use cleanup
function to unmount react tree but that doesn't cancel all the asynchronous tasks.
The motivation: I am calling backend API to clean db after each test. If I don't remove all the async tasks after a test finishes, some API calls might occur after cleaning the db causing errors.