How to use the @pact-foundation/pact.Interaction function in @pact-foundation/pact

To help you get started, we’ve selected a few @pact-foundation/pact examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github replicatedhq / kots / web / src / contracts / ship-cloud-api / contracts / shipauth-signup.js View on Github external
password: "password",
        },
      }
    })
    .then(result => {
      expect(result.data.signup.token).to.equal("generated");
      global.provider.verify();
      done();
    })
    .catch(err => {
      console.error(err);
    })
  });
};

const shipAuthSignupInteraction = new Pact.Interaction()
  .uponReceiving("a query to sign up for a new shipauth account")
  .withRequest({
    path: "/api/v1/signup",
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: {
        email: "test-ship-auth-signup@gmail.com",
        firstName: "First",
        lastName: "Last",
        password: "password",
    },
  })
  .willRespondWith({
    status: 200,
github replicatedhq / kots / web / src / contracts / ship-cloud-api / contracts / auth / interactions.js View on Github external
import * as Pact from "@pact-foundation/pact";
import { Matchers } from "@pact-foundation/pact";

export const shipAuthSignupInteraction = new Pact.Interaction()
  .uponReceiving("a query to sign up for a new shipauth account")
  .withRequest({
    path: "/api/v1/signup",
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: {
        email: "test-ship-auth-signup@gmail.com",
        firstName: "First",
        lastName: "Last",
        password: "password",
    },
  })
  .willRespondWith({
    status: 200,