Skip to content

Commit

Permalink
fix: corrects customProviderHeaders validation (#392) (#393)
Browse files Browse the repository at this point in the history
Co-authored-by: Adam Witko <adam.witko@dunelm.com>
  • Loading branch information
adamwitko and Adam Witko committed Aug 13, 2022
1 parent c8a4669 commit f77dd65
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/verifier/validateOptions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,4 +350,15 @@ describe('Verifier argument validator', () => {
});
});
});

context('when given customProviderHeaders that are defined', () => {
it('should pass through to the Pact Verifier', () => {
expect(() =>
validateOptions({
providerBaseUrl: 'http://localhost',
customProviderHeaders: { my: 'header' },
})
).to.not.throw(Error);
});
});
});
2 changes: 1 addition & 1 deletion src/verifier/validateOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export const validationRules: ArgumentValidationRules<InternalPactVerifierOption
buildUrl: [wrapCheckType(checkTypes.assert.nonEmptyString)],
consumerVersionSelectors: [consumerVersionSelectorValidator],
consumerVersionTags: [consumerVersionTagsValidator],
customProviderHeaders: [wrapCheckType(checkTypes.assert.nonEmptyString)],
customProviderHeaders: [wrapCheckType(checkTypes.assert.nonEmptyObject)],
disableSslVerification: [wrapCheckType(checkTypes.assert.boolean)],
enablePending: [wrapCheckType(checkTypes.assert.boolean)],
format: [deprecatedFunction],
Expand Down

0 comments on commit f77dd65

Please sign in to comment.