forked from pact-foundation/pact-js-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
52 lines (45 loc) · 1.07 KB
/
test.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
const Pact = require('bindings')('pact.node');
// result = Pact.pactffiVerify(
// '--file\ntest/paaeuocts/foo.json',
// (err, result) => {
// if (err) {
// throw err;
// }
// console.log(result);
// }
// );
// console.log(Pact.pactffiVersion());
// result = Pact.foo(['arg1', 'arg2']);
Pact.pactffiInitWithLogLevel('debug');
handle = Pact.pactffiVerifierNewForApplication('pact-node', '1.x.x');
console.log(handle);
Pact.pactffiVerifierSetProviderInfo(
handle,
'pactflow-example-provider',
'http',
'localhost',
1234,
'/'
);
Pact.pactffiVerifierBrokerSourceWithSelectors(
handle,
'https://testdemo.pactflow.io',
'',
'',
'AtDElACja4sv6l_RtI-bAw',
true,
'',
['dev', 'prod'],
'main',
[`{"mainBranch": true}`],
['dev', 'prod']
);
// Pact.pactffiVerifierAddFileSource(
// handle,
// '/Users/matthewfellows/development/public/pact-js/examples/mocha/pacts/myconsumer-myprovider.json'
// );
Pact.pactffiVerifierExecute(handle, (a, b) => {
console.log('done', a, b);
Pact.pactffiVerifierShutdown(handle);
});
console.log('done!');