{"library":"fake-xml-http-request","type":"library","category":null,"description":"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.","language":"javascript","status":"maintenance","version":"2.1.2","tags":["javascript"],"last_verified":"Wed May 27","install":[{"cmd":"npm install fake-xml-http-request","imports":["import FakeXMLHttpRequest from 'fake-xml-http-request';","xhr.respond(200, {'Content-Type': 'application/json'}, '{\"key\":\"value\"}');","const xhr = new FakeXMLHttpRequest(); xhr.open('GET', '/api/data'); xhr.send(); xhr.abort();"]},{"cmd":"yarn add fake-xml-http-request","imports":[]},{"cmd":"pnpm add fake-xml-http-request","imports":[]}],"homepage":null,"github":"https://github.com/trek/FakeXMLHttpRequest","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/fake-xml-http-request","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/fake-xml-http-request/compatibility"}}