Hazem Borham
08/23/2022, 10:29 PMYousaf Nabi (pactflow.io)
Hazem Borham
08/23/2022, 10:53 PMMatt (pactflow.io / pact-js / pact-go)
However, one of the bullet points on the slide Why and when would I use this? mentions Legacy systems that can’t be unit tested. I automatically related this in our product’s context as external systems that can’t be unit tested.yep, it’s probably a separate bullet point but you can definitely try this
Matt (pactflow.io / pact-js / pact-go)
Hazem Borham
08/24/2022, 3:05 PMShen-Yu Sun
08/24/2022, 11:35 PMMatt (pactflow.io / pact-js / pact-go)
cy.intercept
I believe so. Have you tried it?
@Shuying Lin is that right?Matt (pactflow.io / pact-js / pact-go)
Our API integration(e2e) test is using Cypress to making network requestmay I understand why you use Cypress for this? It seems like a bad idea to me, but I’d love to know why you chose Cypress for this task
Shen-Yu Sun
08/24/2022, 11:48 PMShen-Yu Sun
08/24/2022, 11:49 PMCypress helps you test the entire lifecycle of HTTP requests within your application.
Matt (pactflow.io / pact-js / pact-go)
, the reason we are using cypress to run our API e2e was because we are trying to use the same tool for all our testing. UI e2e, API e2e, etc.😱
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
cy.request
bypasses this: https://docs.cypress.io/api/commands/request#cy-intercept-cy-server-and-cy-routeMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
cy.request
directly, you’re bypassing the consumer code altogether so you have no confidence that your consumer actually needs or does make those API calls.Matt (pactflow.io / pact-js / pact-go)
Shen-Yu Sun
08/25/2022, 12:02 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Shen-Yu Sun
08/25/2022, 12:04 AMShen-Yu Sun
08/25/2022, 12:05 AM