Giter Site home page Giter Site logo

Comments (5)

cbornet avatar cbornet commented on June 19, 2024 2

@ICEDLEE337 did you see https://github.com/pact-foundation/pact-stub-server ?

from pact-mock_service.

ICEDLEE337 avatar ICEDLEE337 commented on June 19, 2024 1

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!

from pact-mock_service.

ichyr avatar ichyr commented on June 19, 2024

@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:

  1. Write down the test in js-dsl
  2. run specilized gulp task that will run the pack mock server, run all test with pact js consumer dsl, hut the server.
  3. then read the generated pact files in the onPrepare method of protractor.js to populate some accessible in all of the e2e test variable
  4. use the data from pact.json's in $httpBackend to set up request|response in different use cases.

from pact-mock_service.

ICEDLEE337 avatar ICEDLEE337 commented on June 19, 2024

This would be a great feature. How is this not possible already?

from pact-mock_service.

bethesque avatar bethesque commented on June 19, 2024

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.

from pact-mock_service.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.