Skip to content

Instantly share code, notes, and snippets.

@akshitzaveri
Last active April 23, 2020 17:28
Show Gist options
  • Save akshitzaveri/c6075971c1df93fbd695eb05e9301dc3 to your computer and use it in GitHub Desktop.
Save akshitzaveri/c6075971c1df93fbd695eb05e9301dc3 to your computer and use it in GitHub Desktop.
Setup Firebase Firestore connecting to localhost
// Checking if unit tests are running
if ProcessInfo.processInfo.environment["unit_tests"] == "true" {
print("Setting up Firebase emulator localhost:8080")
let settings = Firestore.firestore().settings
settings.host = "localhost:8080"
settings.isPersistenceEnabled = false
settings.isSSLEnabled = false
Firestore.firestore().settings = settings
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment