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
Suppress console errors on testing #329
Comments
Something like:
|
@leo Can this be a implemented ? Ignoring the logs is great when you're running tests that should throw, if any other test throws the test runner will tell you that so no need to log for errors, the only downside I can see is if the error thrown by the test runner is being cached (by a try/catch - catch()) you will notice anything, but that's just a bad practice that will break the entire test there was an implementation for it before: #124 |
Another suggested implementation. If you provide console as an input defaulted to the native console command, we can override it when testing. I plan just to use my own version of sendError for the time being, however it would be nice if this came out of the box with Micro. Also useful if you want to pass in a custom logger. Current implemenation
Suggested implementation
No breaking changes. Happy to pull request this if you will accept it. |
Any updates on this? I thought #124 fixed it but still gets errors being logged when the default error handler is used. |
Check this comment: #349 (comment) |
Going to close this in favor of #369 |
@cyberwombat this is a common issue across testing in general. I've build a tool for that some time ago: https://github.com/lucasconstantino/console-suppress |
Could it be possible to not dump errors to console while in test env? It makes a total mess of tests. I have to compose all my handlers with a try/catch to swallow the dump. My error is tested through AVA throws but my screen gets filled with production error dumps.
The text was updated successfully, but these errors were encountered: