-
Notifications
You must be signed in to change notification settings - Fork 67
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
Using pact-mock-server as mock data provider? #35
Comments
@bethesque sorry for disturbance. I guess the library was not intented to work as I would like it to :) Great job for doing it by the way. I will investigate the ruby source code deeper, becasue this is the most complicated source code that works that I've seen in my life :). I would like to understand how it works. Looks beautiful. We will use it in the following way to use generated pacts as data-providers for our test:
|
This would be a great feature. How is this not possible already? |
Mainly because the mock server was not designed to be used in this way, and partially just because of time. We're actually close to being able to use it this way now, as the matching rules for the request are now serialised in the pact. Previously, these were discarded, as they were not needed in the provider verification. |
Understood. This will add tremendous value because it enables accurate, pre-fabbed mocks for developing the client code now with bonafide contracts thereby greatly reducing unknowns at dev time! Personally, I just wrote a simple node service that picks up the outputted Pact json contracts and registers the Pact '$.path' regexes as Express endpoints, which then return the defined Pact response. A basic implementation is like ~40 lines of JS so it wasn't bad at all, but it'll be great to see this feature integrated in the Pact suite. Anyway, thanks and keep up the great work! |
Can I use the pact-mock-service as data-provider for my integration and unit test?
If it possible to implement the following scenario:
Thus populate the pack-mock-server with interactions and query it for responses from those interactions.
So we will use the interaction definitions as definition of mock data for our tests.
The text was updated successfully, but these errors were encountered: