Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question mark is ignored when it's used in get uri #2182

Closed
AyoubBani opened this issue Apr 8, 2021 · 3 comments
Closed

question mark is ignored when it's used in get uri #2182

AyoubBani opened this issue Apr 8, 2021 · 3 comments
Labels
stale support General questions or support.

Comments

@AyoubBani
Copy link

I'm having issue using nock with an endpoint that has a question mark ex:

nock(USER_SERVICE_URL) .get('/user?type=person') .reply(200, REMOTE_PERSONS_MOCK);

when checking nock.pendingMocks() I get http://user-service/user

I also tried using nock like this but it didn't help

nock(USER_SERVICE_URL) .get('/user') .query({type: 'person'}) .reply(200, REMOTE_PERSONS_MOCK);

@mastermatt
Copy link
Member

nock.pendingMocks() is not meant to return the search component of the href, however, it will still match requests as expected. And you not seeing Nock intercept requests? Have you tried enabling debug logging? https://github.com/nock/nock#debugging

@mastermatt mastermatt added the support General questions or support. label Apr 13, 2021
@stale
Copy link

stale bot commented Jul 21, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We try to do our best, but nock is maintained by volunteers and there is only so much we can do at a time. Thank you for your contributions.

@gr2m
Copy link
Member

gr2m commented Nov 7, 2021

closing in favor of #2234

@gr2m gr2m closed this as completed Nov 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale support General questions or support.
Projects
None yet
Development

No branches or pull requests

3 participants