jameslnewell / xhr-mock

Utility for mocking XMLHttpRequest.
196 stars 48 forks source link

fix #101 : fixed compare URL with query string #103

Open smilexx opened 4 years ago

smilexx commented 4 years ago

Hi. Added the ability to make a request with query parameters. Please see the request.

101

Example:

mock.get('http://example.com/api/user', (req, res) => { return res.status(200).body('{"data": "1"}'); });

xhr.open('http://example.com/api/user?test=1');

jameslnewell commented 4 years ago

Thanks for your contribution!

Could you please add a test that would be failing without this fix.

How do you think we version this? Given the behaviour has been in the wild for a while, do you think this will break users who have come to expect the broken behaviour?

bpinto commented 3 years ago

Perhaps a better fix could be https://github.com/jameslnewell/xhr-mock/issues/101#issuecomment-624516178 ?