Local Testing - Firebase Realtime Database

1,639 views
Skip to first unread message

Kaan Soral

unread,
Oct 15, 2017, 6:18:20 PM10/15/17
to Firebase Google Group
Hello everyone,

I'm wondering whether this example can be emulated locally: https://cloud.google.com/solutions/using-firebase-real-time-events-app-engine


There is a local emulator for the google cloud functions, yet I'm unsure whether it also has realtime database routines (for example, is there a local/testing version of the JS SDK, and so on)

Alan deLespinasse

unread,
Oct 17, 2017, 12:31:08 PM10/17/17
to Firebase Google Group
Here's an old thread about testing and local database servers (mainly just about RTDB): https://groups.google.com/forum/#!msg/firebase-talk/Sl_aA0lSd78/Y7vNgFYACAAJ;context-place=topic/firebase-talk/CKM90JgJHI4

Doug Stevenson

unread,
Oct 17, 2017, 6:03:12 PM10/17/17
to Firebase Google Group
You can certainly use the (new) Cloud Functions shell to test database triggers locally:


You just need to provide the data that changed, and the function will pretend as if that database change occurred.

Doug

Kaan Soral

unread,
Oct 20, 2017, 5:57:13 PM10/20/17
to Firebase Google Group
Thanks for the replies, however, as far as I understand, the realtime database itself can't be emulated locally (which would be a local server, local address, emulating the realtime database locally)

Coming from App Engine, this was a huge bummer, as you can replace almost all of App Engine's services locally

I assumed it was already available, spent 1-2 days seeking how it could be done, only to painfully discover it's not there

Alan deLespinasse

unread,
Oct 21, 2017, 10:35:03 PM10/21/17
to Firebase Google Group
No, there is a way. See the link I posted above; you should try firebase-server. I've never figured out how to do authentication with firebase-server, though, so I've only used it for a few tests with the rules set to allow unauthenticated read/write.
Reply all
Reply to author
Forward
0 new messages