jameslnewell / xhr-mock

Utility for mocking XMLHttpRequest.
196 stars 48 forks source link

Add proxy handler to original XHR #18

Closed AlehVasilyeu closed 7 years ago

AlehVasilyeu commented 7 years ago

Hi, here is pull requests that covers issue #11, also additionally slightly changed building.

AlehVasilyeu commented 7 years ago

Seems checks failed due to old node 0.10 (one of modules uses arrow functions)? Is it ok to have such old node? :)

AlehVasilyeu commented 7 years ago

Also I have idea, why do not put dist into package also? User by default will not build package.

niekbosch commented 7 years ago

I have read up on this thread. It comes at exactly the right time for me: I started looking for a mocked version of xhr last week and was not able to find exactly what I need. This package (xhr-mock) came closest, with just those things missing that are being handled in this PR: having a build/browserified version directly in the NPM package and the proxy functionality, where unmocked requests get forwarded to the real xhr object.

If I may give my opinion on some topics addressed in this PR discussion: