https://pact.io logo
#pact-js
Title
# pact-js
b

Bernard Baker

04/05/2022, 3:22 PM
Hi, I'm testing against the latest stubs after my provider has published a contract. And I'm seeing this in the logs. Stub URL:
Copy code
https://<our domain>.<http://pactflow.io/pacts/provider/<provider>/consumer/<consumer>/latest/stub/|pactflow.io/pacts/provider/<provider>/consumer/<consumer>/latest/stub/>
Logs:
Copy code
I, [2022-04-05T15:18:42.151021 #53]  INFO -- : Registered expected interaction POST /api/v2/login
W, [2022-04-05T15:18:43.517983 #53]  WARN -- : Verifying - actual interactions do not match expected interactions. 
Missing requests:
	POST /api/v2/login
The tests fail on:
Copy code
await mockProvider.verify();
m

Matt (pactflow.io / pact-js / pact-go)

04/05/2022, 9:02 PM
the stubs aren’t for use during your contract tests, you use the local mock server for that
stubs are for use cases outside of Pact directly (e.g. cypress browser tests)
b

Bernard Baker

04/06/2022, 9:54 AM
Oh, I see.
m

Matt (pactflow.io / pact-js / pact-go)

04/06/2022, 10:13 AM
May I ask what gave you the impression they were for use in Pact unit tests?
We might need to address our documentation
b

Bernard Baker

04/07/2022, 12:39 PM
It just wasn't clear that they shouldn't be used for them.
This was helpful: stubs are for use cases outside of Pact directly (e.g. cypress browser tests)
👍 1
m

Matt (pactflow.io / pact-js / pact-go)

04/07/2022, 12:58 PM
Thanks Bernard - I think we’ll clarify that on the page. Apologies for the confusion (and also - thanks for coming along and I hope the webinar was helpful!)
b

Bernard Baker

04/08/2022, 10:22 AM
It was helpful, really informative and much simpler to understand and convey to other colleagues afterwards.
🙌 1
2 Views