Hello, In one of our projects (React, NodeJS tech ...
# general
s
Hello, In one of our projects (React, NodeJS tech stack) we are using BFF (backend for front end, which in our case is Consumer) to speak to domain services (provider). Any tips on how can I write consumer driven tests for BFF queries?
y
Hey @Subrahmanyam Rentala, We often advise against traditional Pact contract testing for BFF's. see here We think our new feature Bi-directional contract testing over at Pactflow might be more suitable for these pass-through layer use-cases, @Matt (pactflow.io / pact-js / pact-go) wrote a blog here https://pactflow.io/blog/bi-directional-contracts/ and we discuss some of the use cases for BDCT here which although doesn't explicitly call out BFF's. might help provide some food for thought
❤️ 1
🙌 1
👍 1
m
I wouldn’t say it’s not applicable to BFFs, but depending on how much of a pass through it is, it might not be ideal. If the BFF has actual logic and is not just a proxy, CDC should be OK
☝️ 1
s
Our BFF is acting like a proxy.. just gets the response from domain service and wrapping it into its own response model..
m
hmm that’s tricky. Can’t just ignore it, because the shapes are different