'How to test file upload into storage in firebase emulator?

I have a UI which will receive a file from the user/the user uploads a file which is stored in firebase storage. How to test this in emulator? Which storage bucket should I give? The real storage bucket or emulator bucket?



Solution 1:[1]

To test your Cloud Functions code for uploading a file to a bucket in Cloud Storage using Emulator you need to use the bucket name of Storage Emulator. By default the emulator suite will have a bucket named project-id.appspot.com, which is also the name of the default bucket for production Firebase Storage.

I found this link on Using Firebase Emulator for Testing File Upload to Firebase Storage Using Firebase Functions, that contains a video demonstrating the whole process of using Emulator, which I think is really useful.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Zeenath S N