browserify / browserify/http-browserify

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

Offen
#68 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
245
Forks
104
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript
Bereich
testing-qa
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.