The Firebase Emulators make it easier to fully validate your app's behavior and verify your Firebase Security Rules configurations. Use the Firebase Emulators to run and automate unit tests in a local environment.
Install the Firebase Emulators
Start the emulator using the following command. The emulator runs during all your tests.
firebase emulators:start --only firestore
firebase emulators:start --only database
Set up tests and run the emulator
For a few basic test cases with simple rules, try out the testing quickstart.