jameslnewell / xhr-mock

Utility for mocking XMLHttpRequest.
196 stars 48 forks source link

Use 'global' package instead of accessing `window` directly #7

Closed orbiteleven closed 8 years ago

orbiteleven commented 8 years ago

When testing directly on node, window doesn't exist. https://github.com/Raynos/global provides a good fallback for this.

jameslnewell commented 8 years ago

Thanks! I hadn't thought about using it for tests running in node.

orbiteleven commented 8 years ago

Yeah, for sure! Trying to do browser-less tests (i.e. no PhantomJS, JSDOM, etc.) for some stuff around XHR. Thanks for the rest of the work; this lib seems to do the trick!