Hi Team, I need to write consumer tests for an end...
# pact-js
h
Hi Team, I need to write consumer tests for an end-point which returns a json along with a streaming response. In the earlier version of this end-point, I just needed to validate the json and the provider-tests ran successfully. But in the latest api version, along with the json, its now also returning a streaming response, due to which my provider tests are failing as I have not included that in my expected response. Can anyone share a solution to handle the streaming response please?
m
When you say streaming, are you talking about http/2 or something else?
h
its basically an event-stream not sure if its http/2 or something else
m
The technology likely matters. Is it one way communication or bi-directional? You could possibly model it as an Async message or Synchronous Message
h
api response content-type is text/event-stream
m
This is probably best modelled as a message pact OR you could consider creating an SSE plugin (docs.pact.io/plugins)
h
do you have any working code on the git wherein you have handled event-stream which we can refer?
m
I don’t sorry, but I would look at any of the SNS/Kafka type examples as inspiration
🙌 1