http-browserify
http-browserify copied to clipboard
Allow XMLHttpRequest to be mocked by test frameworks (e.g., jasmine-ajax; sinon)
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.
Any progress on this @jonprins?
My pull request is being ignored :(
I may clean it up and re-submit.