DiUS / pact-consumer-js-dsl

*DEPRECATED* A Javascript DSL for creating pacts, superceded by Pact JS
https://github.com/pact-foundation/pact-js
Other
56 stars 26 forks source link

Added `.resetSession` to allow clearing out pact-mock-service #54

Closed aaronrenner closed 8 years ago

aaronrenner commented 8 years ago

I usually like leave my pact-mock-service instance running as I develop my pact tests. However, if I tweak a pact test I end up with the following error and have to restart my server.

pact-consumer-js-dsl: Pact interaction setup failed
An interaction with same description ("a sample request") and provider state ("the server is can handle a sample request") but a different response body has already been use d. Please use a different description or provider state.

This change allows me to call provider.resetSession in a beforeAll block and make sure pact-mock-service is in a clean state before running my test suite.

aaronrenner commented 8 years ago

It looks like this build error was due to an issue with npm install.

mefellows commented 8 years ago

Thanks @aaronrenner! I'll take a look at this over the weekend.

aaronrenner commented 8 years ago

@mefellows Just was curious if you've had a chance to look at this?

mefellows commented 8 years ago

Sorry @aaronrenner, I have not yet had the opportunity to go through it all. I've contacted some colleagues to assist. My main concern is putting any emphasis on the resetSession() call as for new comers this could be confusing (used incorrectly, they will not get a correct Pact file), I'm sure this is something we can sort out via documentation.

mefellows commented 8 years ago

FYI re-ran the build and all is green!

uglyog commented 8 years ago

This is just invoking the /DELETE command from the mock server, so it is adding existing mock server functionality to the JS DSL.