Why Fireemu
Fireemu is a local emulator for testing applications built with Firebase. It aims to match production Firebase behavior, so you can test locally and in CI without using a real Firebase project.
The Firebase Local Emulator Suite is Google’s official tool. It covers more products than Fireemu, and it is the right choice when you need one of them. Fireemu has a narrower aim: tests whose results carry over to production, in CI and on a developer’s machine.
Compared with the Local Emulator Suite
Section titled “Compared with the Local Emulator Suite”Local Emulator Suite (firebase-tools 15.28.2) |
Fireemu | |
|---|---|---|
| Maintained by | The Fireemu project | |
| Products | Firestore, Realtime Database, Authentication, Cloud Storage, Functions, Pub/Sub, Eventarc, Cloud Tasks, Hosting, App Hosting, Data Connect, Extensions | Firestore, Authentication, Cloud Storage, Functions, Pub/Sub, Eventarc, Cloud Tasks, Realtime Database and Hosting (both partial), App Check. App Hosting and Data Connect are not yet supported, and Extensions are not planned (status) |
| Runtime | The Firestore and Realtime Database emulators run as Java (java -jar) processes next to the Node.js CLI |
A single native binary, installed and started through the npm package (Node.js 20 or newer) |
| Startup and memory, Firestore only | 3,043 ms until the SDK can use Firestore; 390 MiB idle memory (PSS) | emulator profile: 140 ms; 11 MiB. One standard run at commit f3b942c on a GitHub Actions Linux runner, JDK 21.0.8, five measured pairs (conditions) |
| A query whose composite index is not defined | The query runs | strict profile (the default): FAILED_PRECONDITION with the console link, as production answers; with firestore.missingIndexes = "report" the query runs and the missing index is reported. emulator profile: the query runs, as in the Local Emulator Suite |
| TOTP multi-factor authentication | The Authentication emulator accepts phone (SMS) second factors; other factor types are answered with MFA provider not supported! |
Both profiles: TOTP and SMS, through the project’s MFA configuration |
| App Check | No App Check emulator | Both profiles: debug-token exchange, and enforcement for Authentication, Firestore, Storage and callable functions; no attestation providers (details) |
More differences that change a test result, with production’s answer next to each, are in the compatibility tables.
What Fireemu adds
Section titled “What Fireemu adds”The Local Emulator Suite is built for local development of a Firebase app. Fireemu adds checks that production applies and that matter for CI:
- Configuration that production requires. A Firestore query whose composite index is not declared in
firestore.indexes.jsonis refused understrict. - Features the official emulator does not serve. TOTP multi-factor authentication, App Check with debug tokens and, under
strict, thebeforeEmailSentblocking function. - Control over test execution conditions. Set an arbitrary start time and move a virtual clock to run scheduled functions without waiting for the real schedule.
Production first
Section titled “Production first”Where the official emulator and production Firebase differ, Fireemu follows production under its default strict profile, and records the difference. The exceptions are the development defaults described below. The answers keep production’s wording and status codes, so the errors your application handles in tests are the errors it will meet after you deploy.
Each behavior is checked against recordings from real Firebase projects. The compatibility tables list every area that has been verified this way and how many conditions it covers.
Some production behavior is costly in a test: production needs signed tokens, signing keys, or a feature enabled through an Admin API call. Fireemu keeps a development default that works without setup for each of these, because reproducing them exactly would slow tests down without finding more bugs. Each one is documented and has its own setting; productionExact, an advanced switch, restores production’s behavior for all of them. See Where Fireemu departs from production on purpose.
Built for tests
Section titled “Built for tests”- One command for CI.
fireemu exec -- npm teststarts the emulators, runs your tests with the emulator environment variables set, stops everything and returns the test command’s exit status. - Reuses your
firebase.json. Rules, indexes, Functions codebases and ports are read from it on every start. - Explains denials. Each Security Rules denial is printed with the conditions that were evaluated and their results.
- Independent test worlds. The
fireemu/testinghelper starts isolated emulator instances with their own clock, Rules, Functions and data, for parallel integration tests. - A single native binary. See Performance for the measured numbers and their conditions.
What it is not
Section titled “What it is not”Fireemu does not reproduce real quota accounting, billing, IAM, organization policies, regional or network differences, or service rollouts, and local performance does not predict production latency. See Limitations.
Next: Install and run, or migrate from the Local Emulator Suite.