Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

customProviderHeaders validation fails for well typed customProviderHeaders during verification #392

Closed
5 tasks done
adamwitko opened this issue Aug 12, 2022 · 2 comments
Closed
5 tasks done
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@adamwitko
Copy link
Contributor

Software versions

  • OS: Mac OSX 12.3
  • Pact Node version: 13.7.2
  • 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
  • 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

Well formed customProviderHeaders are passed to the verification.

Actual behaviour

An error is thrown when executing the verification.

TypeError: customProviderHeaders

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

      at assertImpl (../../../../../pact-provider/node_modules/check-types/src/check-types.js:730:11)
      at assertPredicate (../../../../../pact-provider/node_modules/check-types/src/check-types.js:718:5)
      at ../../../../../pact-provider/node_modules/check-types/src/check-types.js:710:14
      at ../../../../../pact-provider/node_modules/@pact-foundation/pact-core/src/verifier/validateOptions.ts:245:22
          at Array.map (<anonymous>)
      at ../../../../../pact-provider/node_modules/@pact-foundation/pact-core/src/verifier/validateOptions.ts:244:13
          at Array.map (<anonymous>)
      at Object.validateOptions (../../../../../pact-provider/node_modules/@pact-foundation/pact-core/src/verifier/validateOptions.ts:232:5)
      at new Verifier (../../../../../pact-provider/node_modules/@pact-foundation/pact-core/src/verifier/index.ts:16:20)
      at Object.<anonymous>.exports.default (../../../../../pact-provider/node_modules/@pact-foundation/pact-core/src/verifier/index.ts:30:56)
      at Pact.verifyPacts (../../../../../pact-provider/node_modules/@pact-foundation/pact-core/src/pact.ts:156:27)
      at ../../../../../pact-provider/node_modules/@pact-foundation/src/dsl/verifier/verifier.ts:110:29
      at Object.<anonymous> (src/__tests__/pact/delivery-promise-service.verifier.spec.ts:34:20)

Steps to reproduce

Specify customProviderHeaders that adhere to the object type { [k: string]: string }.

Relevant log files

Please ensure you set logging to DEBUG and attach any relevant log files here (or link to a gist).

@adamwitko adamwitko added the bug Indicates an unexpected problem or unintended behavior label Aug 12, 2022
adamwitko pushed a commit to adamwitko/pact-js-core that referenced this issue Aug 12, 2022
mefellows pushed a commit that referenced this issue Aug 13, 2022
Co-authored-by: Adam Witko <adam.witko@dunelm.com>
@mefellows
Copy link
Member

Thanks Adam - leaving this open to support the backwards compatible type definition of string[]

@mefellows
Copy link
Member

I've restored the previous type shape support to pact-core in #395 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants