Support for running unit tests with the Firebase emulators #10648
MauScheff
started this conversation in
Feature Feedback
Replies: 2 comments
-
Update: |
Beta Was this translation helpful? Give feedback.
0 replies
-
Are there any plans to support this feature or something that allows unit testing Firebase code? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I would like to use the Firebase emulators as backends for my unit tests.
I would like to start doing test driven development and I have a complex "reactive" system with firebase-functions and firebase-firestore on the back end.
Some logical blocks of my mobile App connect and react to firebase and part of their logic is intertwined with the back end. Because of this, I would like to assume that the backend works.
When writing my Flutter apps unit tests, while I could use Fakes/Mocks for Firebase (suggested approach for unit testing), I think it would be more convenient to load the mock data into the emulators and then test the local logic (in connection with the reactions in the back). I wouldn't say it's a full integration test, because I don't want to test the UI layer (eg. taps). And running integration tests is very slow because it requires running on the device.
Because FlutterFire needs to run on an actual device (eg. Firebase.initializeApp), I'm not able to connect FlutterFire to a local emulator. I think being able to do this could significantly increase my development time.
Is there any way that this can be accomplished? Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions