Skip to content

Example repo for the Why mocking sucks post illustrating testing Firebase services with mocking and with the Firebase emulator.

Notifications You must be signed in to change notification settings

ritza-co/fusionauth-example-firebase-mock-testing-vs-emulation

Repository files navigation

Example testing Firebase services with Mocking vs Emulation

Example repo for the Why mocking sucks post illustrating testing Firebase services with mocking vs with the Firebase emulator.

Prerequisites

Getting Started

Create a Firebase project and download your service account key file from your project configuration. Paste the contents of the service account key into the service_account_key_example.json file.

Test with Mocking

Use the following command to run mocked tests

uv run pytest firebase_test_with_mocking.py

Test with Firebase Emulation

Install the Firebase CLI.

npm install -g firebase-tools

Authenticate the CLI

firebase login

Initialize the project.

firebase init

Initialize Firebase Emulators.

firebase init emulators

Start the emulator.

firebase emulators:start

Run the test against the emulator

uv run pytest firebase_test_with_emulator.py

About

Example repo for the Why mocking sucks post illustrating testing Firebase services with mocking and with the Firebase emulator.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages