i got rid of fetch-everywhere, because it pollutes the global namespace. This means that if you import it in the same context as some other module that relies on fetch, it might produce unexpected behavior (spoiler: this happens when you import both the Stitch and Realm SDKs).
instead of fetch-everywhere we just use node-fetch (which is what fetch-everywhere is wrapping, anyway).
tests that involve mocking the behavior of fetch now work by either using fetch-mock or sinon as before, but explicitly populating it in global for only the lifetime of the test.
fixed a bunch of tests including one that seemed to have broken setup/teardown for local storage
summary of changes:
fetch-everywhere
, because it pollutes the global namespace. This means that if you import it in the same context as some other module that relies onfetch
, it might produce unexpected behavior (spoiler: this happens when you import both the Stitch and Realm SDKs).node-fetch
(which is whatfetch-everywhere
is wrapping, anyway).fetch
now work by either usingfetch-mock
orsinon
as before, but explicitly populating it inglobal
for only the lifetime of the test.