I have some tests for security rules and they prime up a dataset to the local Firestore emulator (using the @firebase/testing
library, pretty much as described here). The tests mostly work, so I think the data really gets to Firestore.
But I cannot see it in the emulator UI.
http://localhost:4000/ > Firestore emulator > Go to emulator shows empty data
Related, I wonder what is the role of the ”project ID” parameter in emulation? It is required when setting up the Firebase app object, but where is it used? The emulator does not provide me a list of emulated projects, to pick from.
Confused.
Ways to replicate (as requested):
$ git clone git@github.com:akauppi/GroundLevel-es6-firebase-web.git
$ cd GroundLevel-es6-firebase-web/rules-test
# You only need to work in the rules-test subproject
$ npm install
...
In another terminal (same folder):
$ npm run start # leave running...
$ npm run test:symbols
The tests should pass (one is skipped).
The running of the tests has primed data to the emulator, and it should still be there. Project id abc
(see "Using session: abc" on the output).
http://localhost:4000/ > Go to emulator
Expected:
- being able to select project
abc
- being able to see the primed data (btw. it's in
data.js
)
Actual:
- there is no project id selection
- there is no data
I know too little to know, what's going on. Maybe @firebase/testing
never reaches the emulator, and I should be using the normal Firebase client, instead?