From Firebase DOCS:
Run functions locally
The Firebase CLI includes a Cloud Functions emulator which can emulate the following function types:
- HTTPS functions
- Callable functions
- Cloud Firestore functions
You can run functions locally to test them before deploying to production.
QUESTION
Is there a way to run cloud functions for Firebase Storage (ex: triggered by file upload) locally or do I need to actually deploy them for testing?
You can run functions locally using either Function Frameworks or Cloud Native buildpacks. Function Frameworks are open-source libraries used within Cloud Functions to unmarshal incoming HTTP requests into language-specific function invocations.
The Firebase Local Emulator Suite is a set of advanced tools for developers looking to build and test apps locally using Cloud Firestore, Realtime Database, Cloud Storage for Firebase, Authentication, Firebase Hosting, Cloud Functions (beta), Pub/Sub (beta), and Firebase Extensions (beta).
firebaser here
Update: the Firebase Emulator Suite now also supports Cloud Storage. This includes uploads to emulated Cloud Storage triggering emulated Cloud Functions.
See the documentation for full details.
Storage has been implemented in firebase tools 9.11.0. I just took it for a test run, and I found that functions running in the emulator are, indeed, triggered by uploads to the emulated storage.
https://github.com/firebase/firebase-tools/issues/1738#issuecomment-843256335
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With