You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Server mocks are great! I have already been using it and works nicely.
I'm using it to mock a GraphQL server. While it has been working fine for my set of simple tests, for me to be able to use it further, I would need to be able to mock requests on the same path but differentiate it on the request body.
Right now it only mocks the request body as JSON (or a string).
I know you mentioned wanting to support a RegExp object, do you have any examples of tests that need that? I was having trouble coming up with something to test here.
CvX
linked a pull request
Jun 21, 2019
that will
close
this issue
Server mocks are great! I have already been using it and works nicely.
I'm using it to mock a GraphQL server. While it has been working fine for my set of simple tests, for me to be able to use it further, I would need to be able to mock requests on the same path but differentiate it on the request body.
It seems that nock does support this use case: https://github.com/nock/nock#specifying-request-body
Note that all requests to a GraphQL server are POST methods.
Supporting request body as String, RegExp and JSON object should do the trick.
The text was updated successfully, but these errors were encountered: