Exposes a mechanism to wait for all currently pending requests to
be completed. This is useful in some testing contexts. For example,
to know when any fetch related async is completed so that you can
run various assertions on the results.
@example
import{ requestsCompleted }from'@data-eden/network'; import{ fetch }from'./my-app-buildFetch'; test('updates data when submitted',asyncfunction(){ awaitrender(...); awaitclick('[some-button]'); awaitrequestsCompleted(fetch); expect(document.querySelector('.some-content').textContent).toMatchSnapshot(); });
Exposes a mechanism to wait for all currently pending requests to be completed. This is useful in some testing contexts. For example, to know when any fetch related async is completed so that you can run various assertions on the results.