Skip to content

zkohi/firebase-testing-samples

Repository files navigation

Test Cloud Firestore Security Rules using Cloud Firestore emulator

Inspired

Setup the Firestore emulator

npm install -g firebase-tools
firebase setup:emulators:firestore

Setup Java

java -version

If Java runtime does not present, you needs to install.

Java SE Downloads

Start up firestore emulator

firebase emulators:start --only firestore

Run tests

npm run test

Start up firestore emulator, run scripted tests, and shut down emulators

firebase emulators:exec --only firestore "npm run test"