0

I am using Firebase Analytics in my Android project. I am also using Robolectric for tests.

When running Robolectric tests are Firebase events sent? During the tests the code does reach

FirebaseAnalytics.getInstance(context).logEvent(eventName, bundle);

but is it actually doing anything?

AL.
  • 36,815
  • 10
  • 142
  • 281
Kaarel Purde
  • 409
  • 1
  • 5
  • 12

1 Answers1

1

Yes, it is doing something.

The app will be logging analytics events according to its configuration according to the google-services.json file that you used to build the app. This is a really good reason to separate your test builds from your production builds. The Firebase team recommends that you create different projects for each one of your test environments (e.g. dev, staging, prod) so that the information gathered in once project does not affected the others.

Take a look at this blog post to get a hold of how things work.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441