<#941 Feature request: support option to not fail ...
# pact-js-development
g
#941 Feature request: support option to not fail if no pacts found Issue created by adamwitko Software versions • OS: Mac OSX 12.3 • Consumer Pact library: @pact-foundation/pact@10.1.0 • Provider Pact library: @pact-foundation/pact@10.1.0 • Node Version: 18.7.0 Issue Checklist Please confirm the following: ☑︎ I have upgraded to the latest ☑︎ I have the read the FAQs in the Readme ☑︎ I have triple checked, that there are no unhandled promises in my code and have read the section on intermittent test failures ☑︎ I have set my log level to debug and attached a log file showing the complete request/response cycle ☐ For bonus points and virtual high fives, I have created a reproduceable git repository (see below) to illustrate the problem Expected behaviour When a provider does not find any pacts to verify the verification resolves with the relevant output describing the result. This means any test libraries do not fail as the promise is resolved. Actual behaviour When a provider does not find any pacts to verify for the consumer version selectors, an error inside the Rust pact_verifier is failing the verification run. Steps to reproduce • Set your options to a standard looking configuration such as the following where there are no consumer pacts published that match the consumerVersionSelectors defined:
Copy code
const verifierOptions = {
      publishVerificationResult: false,
      provider: 'my-service',
      providerBaseUrl: '<http://localhost:8000>',
      providerVersion: '09fe6815',
      providerBranch: 'my-branch',
      logLevel: 'debug',
      pactBrokerUrl: '<https://my-broker/>',
      enablePending: true,
      consumerVersionSelectors: [
        { mainBranch: true },
        { deployedOrReleased: true },
        { matchingBranch: true }
      ],
    }
    
 await new Verifier(verifierOptions).verifyProvider()
Relevant log files debug.log pact-foundation/pact-js