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

Error: Nock: No match for request #1048

Closed
RichardWatkins1 opened this issue Jan 9, 2018 · 5 comments
Closed

Error: Nock: No match for request #1048

RichardWatkins1 opened this issue Jan 9, 2018 · 5 comments
Labels

Comments

@RichardWatkins1
Copy link

I have spec which makes a post request e.g:

const emailRequest = nock('https://emailhost.com')
                                       .post('/api/email/abc-123-def/send', {
                                         'To': ['to@example.com'],
                                         'Data': {
                                           'id': '227',
                                          }
                                      })

This is just example data but running nock version < 9 the spec passes, > 9 it fails with the error message An error occurred: { Error: Nock: No match for request { ....

This is seems to be with the body as I have specs that pass if I remove the body when using version > 9.

Has anyone else come across this issue or is there anything I need to do differently with the body between versions 8 and 9?.

I am using "request": "^2.83.0" to make the request in my code and running "jasmine": "^2.8.0".

@gr2m
Copy link
Member

gr2m commented Jan 9, 2018

could you create a minimal testcase reproducing the problem on runkit.com, like this https://runkit.com/gr2m/5a2b2a9b890d1b00120eada4? That’ll help us help you :)

@CodeJjang
Copy link

CodeJjang commented May 15, 2018

I also have encountered a problem where a deep JSON I send with POST is not matched with nock, even though I manually diff'ed what nock says it expects and what it receives and it was 100% identical. I also tried to use the code outputted from the record function, but same results.
My version however is 9.1.8, and I cannot post an example since it's in an offline environment.

The post body consists of a POJO object which contains a deep JSON string.

@gr2m
Copy link
Member

gr2m commented May 16, 2018

@CodeJjang if you could create a reproducible case, that’d be helpful. Otherwise there is not much we can do

@stale
Copy link

stale bot commented Sep 13, 2018

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.

@stale stale bot added the stale label Sep 13, 2018
@stale stale bot closed this as completed Sep 20, 2018
@lock
Copy link

lock bot commented Oct 4, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue and add a reference to this one if it’s related. Thank you!

@lock lock bot locked as resolved and limited conversation to collaborators Oct 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants