Skip to content

Commit f77dd65

Browse files
adamwitkoAdam Witko
andauthored
fix: corrects customProviderHeaders validation (#392) (#393)
Co-authored-by: Adam Witko <[email protected]>
1 parent c8a4669 commit f77dd65

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/verifier/validateOptions.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,4 +350,15 @@ describe('Verifier argument validator', () => {
350350
});
351351
});
352352
});
353+
354+
context('when given customProviderHeaders that are defined', () => {
355+
it('should pass through to the Pact Verifier', () => {
356+
expect(() =>
357+
validateOptions({
358+
providerBaseUrl: 'http://localhost',
359+
customProviderHeaders: { my: 'header' },
360+
})
361+
).to.not.throw(Error);
362+
});
363+
});
353364
});

src/verifier/validateOptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export const validationRules: ArgumentValidationRules<InternalPactVerifierOption
175175
buildUrl: [wrapCheckType(checkTypes.assert.nonEmptyString)],
176176
consumerVersionSelectors: [consumerVersionSelectorValidator],
177177
consumerVersionTags: [consumerVersionTagsValidator],
178-
customProviderHeaders: [wrapCheckType(checkTypes.assert.nonEmptyString)],
178+
customProviderHeaders: [wrapCheckType(checkTypes.assert.nonEmptyObject)],
179179
disableSslVerification: [wrapCheckType(checkTypes.assert.boolean)],
180180
enablePending: [wrapCheckType(checkTypes.assert.boolean)],
181181
format: [deprecatedFunction],

0 commit comments

Comments
 (0)