FIRESTORE_EMULATORS_HOST's host ignored in clearFirestoreData
https://github.com/firebase/firebase-functions-test/blob/c1dd82b84f5fe4126ca666577a04a7d72e96f2fc/src/providers/firestore.ts#L275
'localhost' value is hardcoded. Thanks makes it impossibe to run emulators on another host.
I encountered this problem when trying to run tests in Dockerized environment.
Because of this clearFirestoreData is also failing with node 18 with ECONNREFUSED ::1:8080 error event though FIRESTORE_EMULATORS_HOST=127.0.0.1:8080 env variable is defined.
I notice that firebase-functions-test IS checking for env variable FIRESTORE_EMULATOR_HOST (as opposed to OP's plural FIRESTORE_EMULATORS_HOST)
@shackijj 's PR would be a good fix, but it hasn't been merged in a long time.
As a workaround, I set my host to "0.0.0.0" in firebase.json
"firestore": {
"host": "0.0.0.0",
},
#184 would resolve this