-
Notifications
You must be signed in to change notification settings - Fork 0
/
pact.js
34 lines (30 loc) · 780 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.Pact
const path = require('path')
const process = require('process')
const consumerName = 'ATD19_OrderWeb'
const providerName = 'ATD19_OrderApi'
const pactFile = path.resolve(
`./pacts/${consumerName}-${providerName}.json`.toLowerCase()
)
module.exports = {
pactFile,
}
const provider = new Pact({
log: path.resolve(process.cwd(), 'logs', 'pact.log'),
dir: path.resolve(process.cwd(), 'pacts'),
logLevel: 'FATAL',
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',
}