I posted this on StackOverflow a little over a week ago. Since I haven't received an answer there yet, I thought I'd ask here too.
I have a notification that appears and then disappears after 4 seconds. I'm using setTimeout to achieve this behavior. In my tests I'm trying to use jest.useFakeTimers and then expect the call to setTimeout. But I'm getting a lot of extra calls to setTimeout that I'm not expecting. I was finally able to track down that the calls are coming from the @sheerun/mutationobserver-shim package which looks like it's used in dom-testing-library.
Is there a way to assert on the number of calls to setTimeout if I'm using react-testing-library?
This is best asked on our spectrum.chat. We try to limit the issue tracker to bugs and features.