-
-
Notifications
You must be signed in to change notification settings - Fork 153
how to use get_it in integration test #106
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
Can you describe, what's an integration test for you? what do you want to mock? In the above example you register a factory. |
Integration test is to test the flow of the app. I have created a bunch of abstract classes and want to provide mock implementation for the integration test. Yes, I did see that example in readme.
But how do I provide this testing variable from my integration test?
|
That looks like a way, but is this the only way? are you able to provide a proper way in the README, that should be a big help for those (including me) who are looking for a solution. |
The question is what is a proper way. it's actually outside the scope of get_it how you provide config values into your app. The way above is nice for CI systems because you can pass them on the command line. |
Maybe that's not a question for here, but would flutter team comes up with something like the android-dagger doc that provides a full solution from development to testing. I think that's what everyone would like to see. |
Uh oh!
There was an error while loading. Please reload this page.
Im new to flutter integration testing so Im quite confused of how to provide mock data for integration test.
I have followed the official doc to create
app.dart
but because i have put my getit setup in app main.dart
So that means I cannot use app.main()
I do have seen people said we can use runApp() and do something like
but the problem is I have got some configuration setup in the app main() as well.
main.dart
How do I keep the integration test with the same setup except for mock data.
Or a more sensible question, what is the best practice for integration test? Can you provide an example please. Thanks
The text was updated successfully, but these errors were encountered: