-
Notifications
You must be signed in to change notification settings - Fork 2.2k
QUESTION: How to inject mock of firebase app in unit tests? #1557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Anyone have feedback on this? Dependency injection is a must have to test apps that use this library. |
@soumak77 There's nothing out-of-the-box for you to use, but it's possible to set it up yourself. Each AngularFire feature takes in some config tokens that are used to make an app. All you need to do is either alias the |
@davideast angularfire2 already makes use of a |
@soumak77 No, the |
Closing since we already have an issue to create testing docs, feel free to continue discussing. |
I am using the following library to mock firebase in my unit tests: https://github.com/soumak77/firebase-mock
I am able to create an entire mock of the
firebase
SDK which I would like angularfire to use during unit testing. In order to achieve this, I would like to pass an instance of a mocked firebase.app.App to angularfire versus angularfire internally creating an app. How would I go about doing this?The text was updated successfully, but these errors were encountered: