Closed wpjunior closed 8 years ago
Thanks for the PR!
What's the use case for this addition? It doesn't look like a standard method on the XMLHttpRequest interface and you can already check the request headers before returning a response e.g.
mock.get('http://localhost/api/user', function(req, res) {
console.log(req.header('content-type'));
return res;
});
@jameslnewell I agree - MockXMLHttpRequest
should just implement the XMLHttpRequest
interface, there's no practical need for this additional method.
ping @wpjunior
Great idea! Tests perhaps?