-
Notifications
You must be signed in to change notification settings - Fork 0
/
pact.js
32 lines (28 loc) · 791 Bytes
/
pact.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const pact = require("@pact-foundation/pact");
const Pact = pact.PactV3;
const path = require("path");
const process = require("process");
const consumerName = "GettingStartedOrderWeb";
const providerName = "GettingStartedOrderApi";
const pactFile = path.resolve(`./pacts/${consumerName}-${providerName}.json`);
module.exports = {
pactFile,
};
const provider = new Pact({
log: path.resolve(process.cwd(), "logs", "pact.log"),
dir: path.resolve(process.cwd(), "pacts"),
logLevel: "info",
consumer: consumerName,
provider: providerName,
});
// used to kill any left over mock server instances in case of errors
process.on("SIGINT", () => {
pact.removeAllServers();
});
module.exports = {
provider,
pactFile,
consumerName,
providerName,
consumerVersion: "1.0.0",
};