This should fail since the callback is never run (hangingFetchData never resolves).
From the linked jest doc:
"If done() is never called, the test will fail (with timeout error), which is what you want to happen."
Oh I see, if done is present, then we should use that to check. We would also need a timeout too. I guess whatever Jest is (10 secs?). Yeah we do not currently look for a callback parameter
I welcome PRs or I can do it, whichever you prefer, I like the idea.
What are you expecting here? You are not calling the resolve function, so the 1st await will hang. Are you hoping for a default global timeout for tests? E.g. 30 seconds?
Yes. I think a global default timer would be good, like 30 seconds. I'll try to code it up.
Hanging should return an error message, IMO. Does Jest normally do that?
I couldn't get the ".length" method to work. I might not be calling it on the right object. My understanding of Jest is limited.
I edited this item at the comment: // MARKER: LOOKHERE-ASYNC-LENGTH
Maybe you can finish it up? I will learn a lot.
If you create a PR, add yourself as a contributor and what you did and when. Usually I put a change log in my notebooks so it would be useful to add that now.
I'd be happy to, but small problem. I thought the "SUGGESTION" option was the ObservableHQ way of doing Pull Requests (PR). I included the link with the "#anchor".
I googled OHQ and pull request, but didn't figure it out. If you tell me what to click, I'll be happy to click it. This is what I see: https://imgur.com/rVDv1Zo