Skip to content

Test against Firebase as it behaves in production

Fireemu is a local emulator for Cloud Firestore, Authentication, Cloud Storage, Cloud Functions, Pub/Sub, Eventarc and the Realtime Database. It mirrors production Firebase behavior, so a test that passes locally or in CI gives you confidence in how your app will behave after deployment.

Node.js 20 or newer is required. Fireemu is published on npm as fireemu.

Terminal window
npm install --save-dev fireemu
npx fireemu init
# Automated tests (CI or local): start the emulators, run your tests, then stop them
npx fireemu exec -- npm test
# Local development: keep the emulators and the Emulator UI (http://127.0.0.1:4000/ui/) running until Ctrl+C
npx fireemu up

init creates fireemu.toml (see Install and run). exec sets the Firebase SDK emulator environment variables for your command and exits with its status. up serves the Emulator UI on port 4000 (change it with --ui-port, or use --ui-port 0 for no UI).

Behaves like production

Under the recommended strict profile, a query with no composite index fails as it does in production, with the same error. The few development defaults are documented and can each be switched. See Why Fireemu for a comparison with the Local Emulator Suite.

Verified against real Firebase

26 areas, from Firestore transactions to Storage Security Rules, are compared with recordings from real Firebase projects.

Built for tests

TOTP multi-factor authentication and App Check debug tokens, which the official emulator does not provide, a virtual clock for scheduled functions, and Security Rules denials that show each evaluated condition.

Small and quick to start

A single native binary. In one benchmark run on a GitHub Actions Linux runner, Fireemu started 21.6x faster than the official Firestore emulator and used about 1/34th of its idle memory (conditions and details).

Product Status What you can test
Cloud Firestore Supported Standard and Enterprise editions, composite index validation, Security Rules
Firebase Authentication (Identity Platform) Supported Sign-in methods, TOTP and SMS MFA, multi-tenancy, OIDC and SAML providers, blocking functions
Cloud Storage for Firebase Supported Firebase and JSON APIs, Security Rules
Cloud Functions for Firebase Supported HTTP, callable, event, scheduled, task queue and blocking functions, from Node.js codebases and, on macOS and Linux, Python codebases
Cloud Pub/Sub, Eventarc, Cloud Tasks Supported Topics, subscriptions, push and pull delivery, custom events, task queues
Firebase App Check Local testing Debug tokens
Firebase Realtime Database Partial REST, realtime protocol, Security Rules, export and import, Functions triggers
Firebase Hosting Supported One firebase.json site: static files, redirects, rewrites (including to local functions), headers, clean URLs, localization
App Hosting, Data Connect Not yet supported
Firebase Extensions Not planned

Partial means served, with a narrower production claim: the Realtime Database is verified against production for recorded cases only. Details are in Limitations. The compatibility tables show the production verification status of each area.

Migrating from the Firebase Local Emulator Suite

Fireemu reads your existing firebase.json (ports, Security Rules, indexes and Functions codebases) as it is, so firebase emulators:exec "npm test" becomes fireemu exec -- npm test, and firebase emulators:start becomes fireemu up. The default strict profile can refuse requests the official emulator completes, such as a query without its composite index; the migration guide lists these and the other differences.