Lavanya
Lavanya

Reputation: 1

pact JS Provider/consumer test

I am using the below git repo to understand usage of pact https://github.com/pact-foundation/pact-js/tree/master/examples/e2e

able to run successfully npm run api but unable to see my pact file in pact broker. Am i missing anything

do we have pact maven version?

wanted to write a provider and consumer test for my api. Beyond this git repo is there step-step document which can help me create provider and consumer test in PACT-JS.

Upvotes: 0

Views: 452

Answers (1)

Matthew Fellows
Matthew Fellows

Reputation: 4065

The command you've provided just runs an API, it doesn't run anything to do with Pact. As per that link, you need to run the following to run the pact tests and publish - I've copied the relevant bits here:

  • npm run test:consumer (from e2e directory) - Run consumer tests
  • npm run test:publish (from e2e directory) - Publish contracts to the broker
  • npm run test:provider (from e2e directory) - Run provider tests

As per the docs we have information for everything you've just talked about:

Upvotes: 2

Related Questions