GitHub
08/13/2024, 2:19 PM"@pact-foundation/pact": "9.8.0",
"@pact-foundation/pact-node": "10.4.0",
node 12.14
Code:
return new MessageConsumerPact(<MessageConsumerOptions>{
consumer,
dir,
pactfileWriteMode: <PactfileWriteMode>'overwrite',
provider
});
Log:
[2020-03-09T12:01:18.816Z] INFO: pact@9.8.0/794 on karl-Dell-Precision-M3800: Verifying message
[2020-03-09T12:01:18.817Z] INFO: pact-node@10.5.0/794 on karl-Dell-Precision-M3800: Creating Message
[2020-03-09T12:01:18.817Z] INFO: pact-node@10.5.0/794 on karl-Dell-Precision-M3800: Creating message pact
[2020-03-09T12:01:19.304Z] INFO: pact-node@10.5.0/794 on karl-Dell-Precision-M3800:
Could not find command "overwrite".
Code:
return new MessageConsumerPact(<MessageConsumerOptions>{
consumer,
dir,
pactfileWriteMode: <PactfileWriteMode>'merge',
provider
});
Log:
[2020-03-09T12:01:53.845Z] INFO: pact@9.8.0/978 on karl-Dell-Precision-M3800: Verifying message
[2020-03-09T12:01:53.846Z] INFO: pact-node@10.5.0/978 on karl-Dell-Precision-M3800: Creating Message
[2020-03-09T12:01:53.846Z] INFO: pact-node@10.5.0/978 on karl-Dell-Precision-M3800: Creating message pact
[2020-03-09T12:01:54.325Z] INFO: pact-node@10.5.0/978 on karl-Dell-Precision-M3800:
Could not find command "merge".
"overwrite" and "merge" result in no pact files being written.
When using "update", it just gives an empty log, but the pact files are written:
[2020-03-09T12:02:25.509Z] INFO: pact@9.8.0/1209 on karl-Dell-Precision-M3800: Verifying message
[2020-03-09T12:02:25.510Z] INFO: pact-node@10.5.0/1209 on karl-Dell-Precision-M3800: Creating Message
[2020-03-09T12:02:25.510Z] INFO: pact-node@10.5.0/1209 on karl-Dell-Precision-M3800: Creating message pact
[2020-03-09T12:02:26.136Z] INFO: pact-node@10.5.0/1209 on karl-Dell-Precision-M3800:
As far as I can see <PactfileWriteMode> is used in two places, <MessageConsumerOptions> and in <MessageProviderOptions>. It doesn't seem to work in the first case though.
How we are currently doing is that before we run consumer tests we remove all the previous pact files and generate new files. Then we publish them to the broker. After that we run the provider tests which verify against the broker pact files published.
pact-foundation/pact-jsGitHub
08/13/2024, 2:19 PM