Allow XMLHttpRequest to be mocked by test frameworks (e.g., jasmine-ajax; sinon)
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- testing-qa
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.
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.
- Dominant language
- JavaScript
- Stars
- 245
- Forks
- 104
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from browserify/http-browserify
-
Difficulty 2/5 1-3 hours Newbie friendliness 52/100
browserify/http-browserify#107 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 42/100
browserify/http-browserify#104 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
browserify/http-browserify#102 ·
-
Needs Maintainer Open
Difficulty 5/5 Over a week Newbie friendliness 15/100
browserify/http-browserify#99 · 2 reactions ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 38/100
browserify/http-browserify#96 · 2 comments · 1 reaction ·
All issues in browserify/http-browserify
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
palladius/rails8-app-on-gcp#145 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
dotenvx/dotenv-vscode#139 ·
-
test-change-proposal
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
web-platform-tests/interop#1455 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
corsairdev/corsair#1764 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100