I'm thinking about a testing strategy for an app that uses Firebase for its datastore. While it's fine for end-to-end tests to make requests to the actual backend, it would be nice to be able to make unit tests of app logic that don't have to go out to Firebase.
It would be very difficult to properly mock a Firebase service, as it would be to mock most sophisticated data stores. Think of this in terms of mocking MySQL or mocking MongoDB.
Assuming your goal is to make the local environment work offline, a quick solution might be to use a local instance. You can grab the firebase-debug.js, save it locally, and call set(/* data */) to initialize it for offline ops.
Otherwise, your best approach would be to encapsulate all the Firebase activity to one class or library. Then you can mock that library rather than your Firebase events. And to quasi-unit test (these are technically not unit tests since they depend on an external service) the library itself, fall back to a local offline Firebase instance or set up a dev database and copy your production data (or some seed data) there.