-
Notifications
You must be signed in to change notification settings - Fork 0
/
pact.js
34 lines (30 loc) · 832 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
33
34
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",
host: "127.0.0.1",
consumer: consumerName,
provider: providerName,
host: "127.0.0.1"
});
// 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",
};