Skip to content

Commit

Permalink
fix: ConsumerVersionSelector interface
Browse files Browse the repository at this point in the history
Based on document of pact_broker:pact-foundation/pact_broker#307, ConsumerVersionSelector interface attributes are not compatible
This fix is to update it

BREAKING CHANGE: fix pact-foundation#285
  • Loading branch information
tonynguyenit18 committed May 7, 2021
1 parent 0a3fe3d commit b1e5afe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ pact.verifyPacts({
| `providerBaseUrl` | true | string | Running API provider host endpoint. |
| `pactBrokerUrl` | false | string | Base URL of the Pact Broker from which to retrieve the pacts. Required if `pactUrls` not given. |
| `provider` | false | string | Name of the provider if fetching from a Broker |
| `consumerVersionSelectors` | false | ConsumerVersionSelector\|array | Use [Selectors](https://docs.pact.io/selectors) to is a way we specify which pacticipants and versions we want to use when configuring verifications. |
| `consumerVersionSelectors` | false | ConsumerVersionSelector\|array | Use [Selectors](https://docs.pact.io/pact_broker/advanced_topics/consumer_version_selectors) to is a way we specify which pacticipants and versions we want to use when configuring verifications. |
| `consumerVersionTags` | false | string\|array | Retrieve the latest pacts with given tag(s) |
| `providerVersionTags` | false | string\|array | Tag(s) to apply to the provider application |
| `includeWipPactsSince` | false | string | Includes pact marked as WIP since this date. String in the format %Y-%m-%d or %Y-%m-%dT%H:%M:%S.000%:z |
Expand Down
8 changes: 4 additions & 4 deletions src/spawn/arguments.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('Pact Util Spec', () => {
{
consumerVersionSelectors: [
{
all: true,
latest: true,
tag: 'prod',
},
{
Expand All @@ -56,7 +56,7 @@ describe('Pact Util Spec', () => {
expect(result)
.to.be.an('array')
.that.includes('--consumer-version-selector')
.and.includes('{"all":true,"tag":"prod"}')
.and.includes('{"latest":true,"tag":"prod"}')
.and.includes('{"tag":"bar"}');
expect(result.length).to.be.equal(4);
});
Expand Down Expand Up @@ -128,7 +128,7 @@ describe('Pact Util Spec', () => {
{
consumerVersionSelectors: [
{
all: true,
latest: true,
tag: 'prod',
},
],
Expand All @@ -147,7 +147,7 @@ describe('Pact Util Spec', () => {
expect(result)
.to.be.an('array')
.that.includes('--consumer-version-selector')
.and.includes('{"all":true,"tag":"prod"}')
.and.includes('{"latest":true,"tag":"prod"}')
.and.includes('{"tag":"foo"}');
expect(result.length).to.be.equal(4);
});
Expand Down
7 changes: 3 additions & 4 deletions src/verifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,12 @@ export default (options: VerifierOptions): Verifier => new Verifier(options);
// A ConsumerVersionSelector is a way we specify which pacticipants and
// versions we want to use when configuring verifications.
//
// See https://docs.pact.io/selectors for more
// See https://docs.pact.io/pact_broker/advanced_topics/consumer_version_selectors for more
export interface ConsumerVersionSelector {
pacticipant?: string;
tag?: string;
version?: string;
latest?: boolean;
all?: boolean;
consumer?: string;
fallbackTag?: string;
}

interface CurrentVerifierOptions {
Expand Down

0 comments on commit b1e5afe

Please sign in to comment.