See:
See the Cloud Functions Hello World tutorial.
-
Read and follow the prerequisites.
-
Install and run the Google Cloud Functions Emulator
npm install -g @google-cloud/functions-emulator functions start
-
Install dependencies:
npm install
-
Set the following environment variables:
export GCF_REGION=us-central1 export FUNCTIONS_TOPIC=[YOUR_PUBSUB_TOPIC] export FUNCTIONS_BUCKET=[YOUR_CLOUD_STORAGE_BUCKET]
-
Run the tests:
npm test