browserify / browserify/http-browserify

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

Open
#68 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
245
Forks
104
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate where the local xhrHttp reference is initialized at require time and where XMLHttpRequest is used. Check the existing test setup for browser HTTP requests, then verify that replacing global.XMLHttpRequest with a mocking library is respected when the request is made.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing-qa
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.