

Set up functions configuration (optional) For example, when testingĪn Authentication trigger, the emulated function could callĪth().getUserByEmail(email). Windows $ set GOOGLE_APPLICATION_CREDENTIALS=path\to\key.jsonĪfter completing these steps, your functions tests can access Firebase and Unix $ export GOOGLE_APPLICATION_CREDENTIALS="path/to/key.json" Set your Google default credentials to point to the downloaded key: When prompted, select JSON for the key type, and click Create.The options menu at right to select Create key. Make sure that App Engine default service account is selected, and use.To set up admin credentials for emulated functions: This applies whether you're using the functions shell or firebase emulators:start.

All other APIs, including Firebase APIs such as Authentication and FCM or Google APIs such as Cloud Translation or Cloud Speech, require the setup steps described in this section.Cloud Firestore and Realtime Database triggers already have sufficient credentials, and do not require additional setup.

If you want your functions tests to interact with Google APIs or other FirebaseĪPIs via the Firebase Admin SDK, you may need to set up
