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
Sometimes multiple requests are only differentiated by the request body, as is often the case with GraphQL queries. When unit-testing code that makes such requests, we often want to provide a different response, depending on the request body OR a pattern within the body.
Currently, we can get close with something like this: MockTransports.http.expect('GET', myUri, respondWith: myResponse);
Ideally, we could do something like this: MockTransports.http.expect('GET', myUri, body: myBody, respondWith: myResponse);
Or,
`MockTransports.http.expectPattern('GET', myUriPattern, bodyPattern: myBodyPattern, respondWith: myResponse);
The text was updated successfully, but these errors were encountered:
Sometimes multiple requests are only differentiated by the request body, as is often the case with GraphQL queries. When unit-testing code that makes such requests, we often want to provide a different response, depending on the request body OR a pattern within the body.
Currently, we can get close with something like this:
MockTransports.http.expect('GET', myUri, respondWith: myResponse);
Ideally, we could do something like this:
MockTransports.http.expect('GET', myUri, body: myBody, respondWith: myResponse);
Or,
`MockTransports.http.expectPattern('GET', myUriPattern, bodyPattern: myBodyPattern, respondWith: myResponse);
The text was updated successfully, but these errors were encountered: