browserify / http-browserify

node's http module, but for the browser
MIT License
244 stars 110 forks source link

Allow XMLHttpRequest to be mocked by test frameworks (e.g., jasmine-ajax; sinon) #68

Open cacieprins opened 9 years ago

cacieprins commented 9 years ago

Currently the local xhrHttp is defined at require-time.

Unfortunately, libraries for mocking out XMLHttpRequests that rely on replacing global.XMLHttpRequest with a mock do not play nicely with this - you've already gained a reference to the real XMLHttpRequest by the time they replace the global.XMLHttpRequest reference.

Will be submitting a pull request to fix.

jednano commented 9 years ago

Any progress on this @jonprins?

cacieprins commented 9 years ago

My pull request is being ignored :(

I may clean it up and re-submit.