Closed michael42 closed 6 years ago
Hi @michael42. Can you please try xhr-mock@next
for me (let me know if you have any issues!). It aligns much closer to the spec.
https://github.com/jameslnewell/xhr-mock/blob/master/src/MockXMLHttpRequest.ts#L37
As per spec, the XMLHttpRequest constructor should define the constants UNSENT = 0, OPENED = 1, HEADERS_RECEIVED = 2, LOADING = 3 and DONE = 4. Otherwise, the following snippet doesn't work as intended when using xhr-mock: