Code Monkey home page Code Monkey logo

Comments (3)

mefellows avatar mefellows commented on July 26, 2024 1

Hi @mohanraj-r,

You are talking about functional testing, which is not something Pact supports. Each interaction must strictly be able to be validated in isolation from another. To achieve this, we use "provider states".

See https://docs.pact.io/best_practices/contract_tests_not_functional_tests.html for a discussion of these functional tests.

If I have misunderstood, and your request is more about being able to match the request path/headers/etc. using matchers, I've just come across a bug for that (related to a @gallamine query) and will release a fix in the next few days.

from pact-go.

mohanraj-r avatar mohanraj-r commented on July 26, 2024

we use "provider states".

Thanks @mefellows
Can you give me an example of how to setup provider states in Go?
Looked at Provider States ยท Pact - but the examples are in Ruby - not clear how I can do the same in Go.

more about being able to match the request path/headers/etc. using matchers

Yes, having the ability to use matchers in the req URL, query etc could be helpful for me in this case as well

from pact-go.

mefellows avatar mefellows commented on July 26, 2024

Have you looked at the examples? The mux example shows how to achieve this with the in-built http package.

The readme also explains this in the provider section.

Hope that helps.

from pact-go.

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.