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
[ 👍 ] Checked the documentation to see if it is possible to do what I want already
Feature description
Maybe i missed it so sorry about that, but is a utility that can be exported from the library to verify the match between given object and a matchingRules?
I'm trying to develop mock network request functionality for playwright tests based on existing generated pact contracts.
Building the routes from the pact JSON files is straightforward, but there is a problem when I have the same path and the same method but different responses.
For example, my contact is UsersConsumer - UsersProvider. The interactions are
GET /users -> response 200 with body { users: [] }
GET /users?limit=10 -> response 200 with body { users: [] }
GET /users -> response 401 with body { users: [] }
GET /users -> response 500 with body { users: [] }
So, to generically decide what my result is based on the request from the playwright, I need to pass the request.body, request.headers, and request.query and matchingRules to a utility to decide if they are matching isMatch(request, interactions.request.matchingRules) => boolean something like that.
Use case
This will help create generic mock servers with any framework or tool.
It can be reused for intercepting calls in Playwright or building custom routes in MSW.
The text was updated successfully, but these errors were encountered:
Checklist
Before making a feature request, I have:
Feature description
Maybe i missed it so sorry about that, but is a utility that can be exported from the library to verify the match between given object and a
matchingRules
?I'm trying to develop mock network request functionality for playwright tests based on existing generated pact contracts.
Building the routes from the pact JSON files is straightforward, but there is a problem when I have the same path and the same method but different responses.
For example, my contact is UsersConsumer - UsersProvider. The interactions are
GET /users -> response 200 with body { users: [] }
GET /users?limit=10 -> response 200 with body { users: [] }
GET /users -> response 401 with body { users: [] }
GET /users -> response 500 with body { users: [] }
So, to generically decide what my result is based on the request from the playwright, I need to pass the request.body, request.headers, and request.query and
matchingRules
to a utility to decide if they are matchingisMatch(request, interactions.request.matchingRules) => boolean
something like that.Use case
This will help create generic mock servers with any framework or tool.
It can be reused for intercepting calls in Playwright or building custom routes in
MSW.
The text was updated successfully, but these errors were encountered: