Unit testing Firebase Cloud Functions using the Firestore emulator

Michael Prather
3 min readJun 12, 2020

Google Firebase simplifies backend development, but its quirks sometimes lead to hours lost searching for solutions. Testing in particular can be challenging, so Google’s recent introduction of the Firebase Local Emulator Suite is encouraging. The Firebase Local Emulator Suite allows for app development and testing to be done locally. This not only prevents unintended changes to production data, but makes unit testing faster and easier. Below are some tips for unit testing Firebase Cloud Functions using the Firestore emulator.

--

--