2

I am using google cloud function written in javascript to do the transformation of an event received from a pub/sub topic and publishing it to another pub/sub topic. Function is working perfectly fine. My question is around testing.

I have been following googles guide to write unit and integration tests. Unit tests are working fine. I am using Jest framework. I am not sure how to complete Integration tests. I am following this link Cloud function is publishing to another topic at the end. How do I test this integration test. I am using functions-framework as suggested by google to do the integration test. Does anyone have any idea how do I inject mock implementation for pub/sub publishing part

Integration test looks similar to this

Pruthviraj
  • 560
  • 6
  • 23

0 Answers0