Skip to content

Commit dcc2ff8

Browse files
committed
adding supplier contract
Signed-off-by: Tim Ireland <[email protected]> updated README Signed-off-by: Tim Ireland <[email protected]>
1 parent 043ae37 commit dcc2ff8

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Verifier } from '@pact-foundation/pact';
2+
import * as path from 'path';
23

34
describe('Pact Verification', () => {
45
it('should validate the expectations of the consumer', async () => {
@@ -9,18 +10,24 @@ describe('Pact Verification', () => {
910
latest: true,
1011
},
1112
],
13+
pactUrls: [
14+
path.resolve(
15+
__dirname,
16+
'../../backend-client/pacts/TemplateClient-TemplateService.json'
17+
),
18+
],
1219
providerBaseUrl: 'http://localhost:8080',
13-
pactBrokerUrl: process.env.PACT_BROKER_URL || 'http://127.0.0.1:8000',
20+
pactBrokerUrl:
21+
process.env.PACT_BROKER_BASE_URL || 'http://127.0.0.1:8000',
1422
pactBrokerUsername: process.env.PACT_BROKER_USERNAME || 'pact_workshop',
1523
pactBrokerPassword: process.env.PACT_BROKER_PASSWORD || 'pact_workshop',
24+
// pactBrokerToken: process.env.PACT_BROKER_TOKEN,
1625
publishVerificationResult: true,
1726
providerVersion: '1.0.0',
1827
};
1928

2029
const verifier = new Verifier(opts);
2130

2231
await verifier.verifyProvider();
23-
24-
throw error;
2532
});
2633
});

lambdas/backend-client/pacts/README.MD

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
# Contracts
1+
# pacts
22
This folder comntains the consumer cretaed contracts (pacts) these are created from lambdas/backend-client/src/__tests__/api.pact.spec.ts
33

4-
5-
64
# Verifier
7-
8-
This runs against the api /lambdas/backend-api/src/__tests__/templates/api/api.pact.test.ts.
5+
This is a unit test which runs against
6+
This runs against the api /lambdas/backend-api/src/__tests__/templates/api/api.pact.test.ts and verifies the pacts generated from the client.
97

108

119
# Bi-directional contract testing

0 commit comments

Comments
 (0)