Open danipralea opened 4 years ago
@danipralea Did you figure out any workaround?
@danipralea Did you figure out any workaround?
nope, didn't knew how to get around it. I talked with someone at the firebase support team and he said it's working like a charm for him with this version:
const projectId = "project-Id";
const databaseURL = "http://localhost:4000/database";
const test = require('firebase-functions-test')({
databaseURL: databaseURL,
projectId: projectId,
});
but for me it still doesn't work. maybe it helps you or anyone else
Are u sure that in your functions databaseURL same as in your tests? I fixed this one and now all works fine
Version info
firebase-functions-test: 0.2.1**
firebase-functions: 3.6.2**
firebase-admin: 8.12.1**
Hello and thank you for reading this. I am struggling for the past few days around this, but I just can't make it work. It all boils down to not being able to connect
firebase-functions-test
to my realtime database emulator.Prior to everything, I do:
I have my admin app successfully updating and retrieving data, so that's fine:
but the issue is with firebase-functions-test package:
If I do this, I get
Invalid value for config firebase.databaseURL: http://localhost:9000/?ns=not-a-project
If I do this:
I get
[2020-06-03T10:36:01.235Z] @firebase/database: FIREBASE WARNING: {"code":"app/invalid-credential","message":"Credential implementation provided to initializeApp() via the \"credential\" property failed to fetch a valid Google OAuth2 access token with the following error: \"Error fetching access token: Error while making request: getaddrinfo ENOTFOUND metadata.google.internal. Error code: ENOTFOUND\"."}
If I do this:
I get
Missing expected firebase config value databaseURL, config is actually{"projectId":"not-a-project"} If you are unit testing, please set process.env.FIREBASE_CONFIG