firebase / firebase/firebase-tools

Can't test HTTPS Callable functions against Emulator firestore/auth

Open
#3,103 9 comments 2 reactions 0 assignees View on GitHub
emulator-suite emulators: functions type: feature request
Dominant language
TypeScript
Stars
4.5k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
84

Description

### [REQUIRED] Environment info

**firebase-tools:** 9.2.2

**Platform:** macOS

### [REQUIRED] Test case

When functions are started using functions:shell command, they don't seem to know that firestore and auth emulators are running, therefore they affect production.

### [REQUIRED] Steps to reproduce
1. Start firebase emulators with the following command: ```firebase emulators:start --only firestore,auth --import=backups/data/emulator-exit-data``` (i.e. without functions)
2. Start functions using: ```firebase functions:shell```
3. Run a function inside the functions shell CL: ```main.createProfile({uid: '8DFFrqmP52TAPYCTGxl6KGny9kF5', fullName:'chris', username:'new', location:'here'})```
4. Get the following response:
```
Sent request to function.
firebase > ⚠ functions: The Firebase Authentication emulator is not running, so calls to Firebase Authentication will affect production.
⚠ functions: The Cloud Firestore emulator is not running, so calls to Firestore will affect production.
⚠ Google API requested!
- URL: "https://oauth2.googleapis.com/token"
- Be careful, this may be a production service.
```

### [REQUIRED] Expected behavior
Expect that the functions will still be able to use the emulator firestore and auth.

### [REQUIRED] Actual behavior
functions use production instead

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.