When doing local development using the Firebase Emulator, it might be useful to run multiple instances of the emulator.
For example, I like to keep one instance of the emulator running for interactive development and another one for running my automated tests in the background.
You can run another instance of the emulator by passing a different configuration file using the --config
file:
firebase emulators:exec --project testing --config="./firebase.test.json" 'jest'
Then, make sure to change the default ports in your firebase.test.json
file:
{
"emulators": {
"auth": {
"port": 9098
},
"functions": {
"port": 5002
},
"firestore": {
"port": 8081
},
"database": {
"port": 9001
},
"pubsub": {
"port": 8086
},
"ui": {
"enabled": true,
"port": 4001
}
}
That will allow you to run two instances of the Firebase Emulator at the same time.
Top comments (1)
How about the storage emulator?
Did you manage to run two of them?
It appears that you cannot change the port it listens to.
Or did I miss anything?