Appendix – testing your code on Google Cloud
I added this section as an appendix because testing is a harder concept that requires more thought and customization, so I consider this as an extra effort that will be worth your while.
When we speak about testing, there are a few basic concepts that we should take into account, as this Google Cloud documentation page mentions: https://cloud.google.com/functions/docs/testing/test-basics.
We should ensure that our code works properly from different perspectives. Let’s introduce the three types of tests.
Types of tests
An important concept to keep in mind is that a portion of code, even if it implements a full service, needs to be tested from different points of view before we can say that it fully works as expected. And for this to be possible, we need to put together a list of tests that, when passed, will confirm that our code is functional in three different scenarios: on its own, as part of a bigger workflow...