● Always had to be online ● Felt a little like you were developing in Prod. ● Teammates would be sad if you broke database ● Using up your free quota for development ● Etc. Dev Environment Cons
● Accessing databases offline ● Can now run end to end tests on CI ● Easily import and export data ● Increase in development productivity ● Unit Testing security rules ● Testing does not contribute to your quota Benefits of UI Emulator
Interacting with UI Emulator Cloud functions Android private fun setUpFirebaseEmulators() { var functions: FirebaseFunctions = FirebaseFunctions.getInstance() functions.useEmulator(host, 5001) } fun addMessage(text: String): Task { val data = hashMapOf(...) return functions .getHttpsCallable("sayHello") .call(data) .continueWith { task -> val result = task.result?.data as String } } addMessage("polls") //Invoking the cloud function
UI Emulator There's more ● Firebase Web Hosting can be tested locally. ● Running containerized Emulator images with CLI on CI ● Emulating Pub/Sub interactions with Cloud Functions ● Realtime Database interaction ● Still able to connect to external services through emulator