FakeXMLHttpRequest for Browser Testing
JSON →This library provides a standalone, spec-compliant fake XMLHttpRequest (XHR) object designed specifically for testing browser-based JavaScript libraries. It is partially derived from Sinon.JS but offers a more lightweight alternative for scenarios where a full mocking, spying, or stubbing framework is not required. The current stable version is 2.1.2, last published over five years ago. Its primary function is to allow developers to simulate XHR requests and responses without making actual network calls, which is crucial for deterministic and fast unit testing. Unlike comprehensive testing frameworks, `fake-xml-http-request` intentionally omits mechanisms for auto-swapping the native XHR, recording requests, or playing back interactions, leaving those concerns to the consuming test environment or framework. Its release cadence appears to be infrequent, driven by spec updates or critical bug fixes, rather than a strict schedule.
Traffic · last 30 days ↑67% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇩🇪 Germany · 🇫🇷 France