The primary goal of this middleware is to expose a mechanism for
consumers to know when all requests are completed. This is very
useful for testing purposes where you may want to author tests in a
higher level way (e.g. “click this button and confirm some content
is updated”).
Note: This middleware is intended to be used in non-production contexts
(e.g. when debugging or running tests).
@example
import{ fetch }from'../network'; import{ requestsCompleted }from'@data-eden/network'; test('updates data when submitted',asyncfunction(){ awaitrender(...); awaitclick('[some-button]'); awaitrequestsCompleted(fetch); expect(document.querySelector('.some-content').textContent).toMatchSnapshot(); });
The primary goal of this middleware is to expose a mechanism for consumers to know when all requests are completed. This is very useful for testing purposes where you may want to author tests in a higher level way (e.g. “click this button and confirm some content is updated”).
Note: This middleware is intended to be used in non-production contexts (e.g. when debugging or running tests).