How to use the @pact-foundation/pact.Verifier 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 pact-foundation / pact-js / examples / graphql / provider.spec.ts View on Github external
it("validates the expectations of Matching Service", () => {
    // lexical binding required here
    const opts = {
      // Local pacts
      // pactUrls: [path.resolve(process.cwd(), "./pacts/graphqlconsumer-graphqlprovider.json")],
      pactBrokerPassword: "O5AIZWxelWbLvqMd8PkAVycBJh2Psyg1",
      pactBrokerUrl: "https://test.pact.dius.com.au/",
      pactBrokerUsername: "dXfltyFMgNOFZAxr8io9wJ37iUpY42M",
      provider: "GraphQLProvider",
      providerBaseUrl: "http://localhost:4000/graphql",
      providerVersion: "1.0.0",
      publishVerificationResult: true,
      tags: ["prod"],
    }

    return new Verifier(opts).verifyProvider().then(output => {
      server.close()
    })
  })
})
github replicatedhq / kots / kotsadm / api / pact / provider_tests_local.js View on Github external
s3rver.run().then(() => {
  console.log("Starting pact verifier");
  new Verifier().verifyProvider(opts).then(() => {
    console.log("Stopping s3 server");
    s3rver.close();
  })
  .catch((err) => {
    console.log("Stopping s3 server");
    s3rver.close();
    console.error(err);
    process.exit(1);
  });
});
github replicatedhq / kots / kotsadm / api / pact / provider_tests_broker.js View on Github external
s3rver.run().then(() => {
  console.log("Starting pact verifier");
  new Verifier().verifyProvider(opts).then(() => {
    console.log("Stopping s3 server");
    s3rver.close();
  })
  .catch((err) => {
    console.log("Stopping s3 server");
    s3rver.close();
    console.error(err);
    process.exit(1);
  });
});