Closed filipesilva closed 4 years ago
Quick check: Does it work when you change databaseURL: "http://localhost:9000?ns=my-db",
to databaseURL: "http://localhost:9000/?ns=my-db",
(with a slash before the question mark)?
Closing due to inactivity.
I have the same problem. it's driving me crazy. I think I spent the last 4 days on it. do you think we can re-open this @laurenzlong ? @yuchenshi : I personally tried with both approaches. it doesn't work with either.
If I init it without any parameters, I get
[2020-06-03T10:16:47.159Z] @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\"."} ```
I followed the instructions on this page to generate a service key json file to include in the config and I am able to connect to my emulated databases now for testing purposes:
Version info
firebase-functions-test: 0.1.7
firebase-functions: 3.3.0
firebase-admin: 8.9.0
Test case
Make any permissions function that uses Realtime Database, and try to use it in a test script against the emulator. Below the function was called
updatePermissionUids
.Steps to reproduce
In one terminal run
firebase emulators:start
, in another one runnode test.js
(where test.js is the file containing the test case`.Expected behavior
No error, and the function runs.
Actual behavior