jameslnewell / xhr-mock

Utility for mocking XMLHttpRequest.
196 stars 48 forks source link

Update MockXMLHttpRequest.ts #39

Closed lifeiscontent closed 6 years ago

lifeiscontent commented 6 years ago

I need this feature for a test I'm stubbing an xhr request against.

jameslnewell commented 6 years ago

Awesome! Thanks your contribribution!

Are you sure that code will do what you expect? If you're setting the header before calling .send() and the handler sets that same header I think you won't be overriding the server value?

Can you please add a test to confirm it works.

jameslnewell commented 6 years ago

ping @lifeiscontent

lifeiscontent commented 6 years ago

@jameslnewell hey sorry, I'm not using xhr-mock anymore so I punted on pushing this to the finish line due to time constraints.