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
How disable print in test async_redux? #62
Comments
Both the You can disable prints by providing a dummy
I will add this information to the docs. |
Even if you add |
Yes, and I also think it should be easier to turn off these prints. Having to pass |
I don't mind flipping the default behavior, so that nothing is printed, as long as you don't provide |
See version 2.6.0: You can now disable all prints globally by making You can also change the print functions globally, since they are not final and private anymore. |
I don't think that this is the best solution. My app state consist of 7 separate state objects that are tested independently. In order to disable prints I need to set global Also having this as a global can lead to unpredictable results depending on the order in which test are loaded. I would rather prefer to change the default behavior of |
@dluksza Changing the default behavior of the Global variables are meant as global configuration. They are there to let you set a default that shouldn't be changed while the program is running. You should pick your default and set it in your test's
|
For me logging from tests is an anti-pattern. Especially right now with dart/flutter, if you have a fair amount of tests for your store (lets say 300+) then when one of them fails you don't see which one is it. This is partly because For TDD or BDD assets should be your source of truth, not logs. Of course logs can help with debugging some bugs. But you should mostly relay on the asserts. I was going to argue that It all depends what is your expectation. If you like to always see the logs in tests, then with the approach you took there is no changes to be made in your code. On the other hand if you (like me) prefer to see which test had failed without scrolling through ton of logs. Then this is not the best approach, since |
Yes, it depends on your expectation, and there's no way to make it perfect and please everyone. At least now it's possible to turn all printing off, and it's still easier than adding I disagree that logging from tests is an anti-pattern, specially when we're talking about the kind of complex integration tests that the |
Hello,
I wanna to do all tests in my project, but I have a lot of prints of the async_redux lib.
I can disable this prints? This is very helpfull, but I wanna know if it this can be disable too.
Thanks for the package.
The text was updated successfully, but these errors were encountered: