pact-foundation / pact-js-core

Core binaries for pact-js, a Contract Testing Framework. NOTE: If you are looking to do Pact contract testing in node, you almost certainly want pact-js, not pact-node.
https://docs.pact.io
MIT License
150 stars 79 forks source link

Failure to use specify customer provider verification headers - 'PactffiVerifierAddCustomHeader(arg 2 expected a string' #388

Closed adamwitko closed 2 years ago

adamwitko commented 2 years ago

Software versions

Issue Checklist

Please confirm the following:

Expected behaviour

Verifier to execute and apply the custom headers.

Actual behaviour

Error when executing the verifier.

PactffiVerifierAddCustomHeader(arg 2 expected a string

Steps to reproduce

Using 13.7.1 of @pact-foundation/pact-node, specify the equivalent customProviderHeaders that@pact-foundation/pact@10.0.2` requires, execute verifier.

E.g.

  { 
    customProviderHeaders: {
      'hello': 'there'
    },
  }

Relevant log files

 ● Pact Verification › validates the expectations on the "my-provider-service" provider

    PactffiVerifierAddCustomHeader(arg 2 expected a string

      32 |       : process.env.CI_COMMIT_BRANCH
      33 |
    > 34 |     const output = await verifyProvider(
         |                    ^
      35 |       {
      36 |         provider: 'my-provider-service',
      37 |         branch: branch!,

      at ../../../../../pact-provider/node_modules/@pact-foundation/pact-core/src/verifier/nativeVerifier.ts:47:9
          at Array.forEach (<anonymous>)
      at Object.verify (../../../../../pact-provider/node_modules/@pact-foundation/pact-core/src/verifier/nativeVerifier.ts:46:49)
      at Verifier.Object.<anonymous>.Verifier.verify (../../../../../pact-provider/node_modules/@pact-foundation/pact-core/src/verifier/index.ts:25:12)
      at Pact.Object.<anonymous>.Pact.verifyPacts (../../../../../pact-provider/node_modules/@pact-foundation/pact-core/src/pact.ts:156:37)
      at ../../../../../pact-provider/node_modules/@pact-foundation/src/dsl/verifier/verifier.ts:110:29
      at Object.<anonymous> (src/__tests__/pact/my-provider-service.verifier.spec.ts:34:20)

[2022-08-11 14:50:46.844 +0000] INFO (36927 on DCM-RJ6KY4W9FP): pact@10.0.2: Verifying provider
[2022-08-11 14:50:46.846 +0000] INFO (36927 on DCM-RJ6KY4W9FP): pact@10.0.2: debug request/response logging enabled
[2022-08-11 14:50:46.847 +0000] INFO (36927 on DCM-RJ6KY4W9FP): pact-core@13.7.1: Verifying Pacts.
[2022-08-11 14:50:46.847 +0000] INFO (36927 on DCM-RJ6KY4W9FP): pact-core@13.7.1: Verifying Pact Files
[2022-08-11 14:50:46.847 +0000] DEBUG (36927 on DCM-RJ6KY4W9FP): pact-core@13.7.1: Initalising native core at log level 'debug'
YOU54F commented 2 years ago

thanks to @TimothyJones for the fix, let us know how you get on @adamwitko

https://github.com/pact-foundation/pact-js-core/releases/tag/v13.7.2

mefellows commented 2 years ago

Thanks folks!

I'll look at the devex for setting up the core locally next week some time.

mefellows commented 2 years ago

I think this is fixed now?