Emulator Snapshots

Save and restore named snapshots of emulator state for fast test data management.

Overview

Snapshots capture the complete state of the Firebase Emulator at a point in time. Save snapshots before destructive tests, then restore them instantly to return to a known state without re-seeding.

Saving a Snapshot

  1. Click Save Snapshot in the emulator panel.
  2. Enter a descriptive name for the snapshot (e.g., “Clean state with 50 users”).
  3. Optionally add a note with additional context.
  4. Click Save.

The snapshot captures all data across all running emulator services (Firestore, Auth, Storage).

Viewing Snapshots

Saved snapshots are listed in the emulator panel with:

  • Snapshot name — the descriptive name you provided
  • Creation date and time — when the snapshot was taken
  • Notes — any additional context you added

Snapshots are stored locally and persist across Stackpane sessions.

Restoring a Snapshot

  1. Find the snapshot you want to restore in the list.
  2. Click Import on the snapshot entry.
  3. The emulator state is replaced with the snapshot data.

Restoring a snapshot overwrites all current emulator data. The operation is fast because it uses the emulator’s built-in import API.

Deleting Snapshots

Click the trash icon on a snapshot entry to delete it. A confirmation dialog ensures you do not accidentally remove a snapshot you still need.

Snapshot Diff

Compare two snapshots to understand what changed between them:

  1. Select two snapshots for comparison.
  2. View the diff showing document-level changes: documents added, modified, and removed.

This is useful for understanding the impact of a test run or a series of operations. For example, take a snapshot before and after running a test suite to see exactly which documents were affected.

Use Cases

Test Isolation

Take a snapshot before running destructive tests. After the tests complete, restore the snapshot to reset to the pre-test state.

Development Milestones

Save snapshots at key points during development (e.g., “after initial schema setup”, “with 100 sample orders”) to quickly switch between data states.

Bug Reproduction

Save a snapshot that reproduces a specific bug, share the snapshot with teammates, and use it as a reliable starting point for debugging.

Tips

  • Name snapshots descriptively so you can identify them later
  • Add notes with context about why the snapshot was created
  • Use the diff feature to verify that your test suite only modifies expected data
  • Clean up old snapshots periodically to save disk space