firebase-test
Firebase rules test helper.
Install
npm install firebase-test --save-dev
Usage
A Firebase-test suite with its chainable method is used to define an initial database, a sequence of operation and the expected result:
const fbTest = ; // Using Mocha BDD;
Firebase test is framework agnostic and will work with any framework supporting callback or promise based async assertions:
; ;
By default the operations are simulated (using targaryen). You can switch to live test by providing a Firebase project ID and a Firebase secret, and setting an alternative driver:
export FIREBASE_TEST_DRIVER_PROJECT_ID=my-project-idexport FIREBASE_TEST_DRIVER_SECRET=xxxxxxFIREBASE_TEST_DRIVER_ID=live mocha -b path/to/assertions.js
When run live, you should make sure the different test runs are not run concurrently. If you're using a CI service like Travis limit concurrent jobs to one.