Have ideas to improve npm?Join in the discussion! »

    btrz-pact

    0.1.0 • Public • Published

    btrz-pact

    Pact library for Betterez APIs consumers. Is a requirement to have a pact broker server to connect with.

    Features:

    Publish and Verify the consumer pacts to the Betterez pact_broker

    How to use

    Initializing btrz-pact

    let options = {
      brokerUrl: "localhost",
      user: "",
      pass: ""
    };
    btrzPact = new BtrzPact(options);
    

    Publish pacts

    let pactList = ["path/to/pact"]; // or use a folder containing pacts to publish
    let version = "1.0.0";
    btrzPact.publish(pactList, version)
      .then(() => {
        // do your stuff here...
      })
      .catch((err) => {
        // process error
      });
    

    Verify pacts

    let providerBaseUrl = "host/to/api/endpoint";
    let pactList = ["path/to/pact"]; // or use a folder containing pacts to verify
    btrzPact.verify(providerBaseUrl, pactList)
      .then(() => {
          // do your stuff here...
        })
        .catch((err) => {
          // process error
        });
    

    Keywords

    Install

    npm i btrz-pact

    DownloadsWeekly Downloads

    2

    Version

    0.1.0

    License

    MIT

    Last publish

    Collaborators

    • avatar
    • avatar