Skip to content
This repository has been archived by the owner on Jan 23, 2018. It is now read-only.

silence logging from components while running tests #568

Closed
wants to merge 3 commits into from
Closed

silence logging from components while running tests #568

wants to merge 3 commits into from

Conversation

leethomas
Copy link
Contributor

Hey guys, this closes #463.

I tried using mocha & karma config options to silence all of the logging coming from the client code, but nothing I tried worked. I finally decided to just redefine console.log while tests are running. The test output is a lot cleaner now.

tests

@@ -3,5 +3,11 @@
// See: https://github.com/webpack/karma-webpack#alternative-usage
import 'babel-core/polyfill';

// silence logging in components
var logLevels = ['log', 'warn', 'info', 'error'];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about debug? It obviously doesn't get used but adding it would be future-proof.

@tofumatt
Copy link
Contributor

That is sooooo much easier to look at, thank you! 👍

I have a question about debug level console stubbing, but otherwise r+ from me.

Let me know what you think--feel free to either add debug and the comma or just let me know and I can amend the commit before merging myself.

@leethomas
Copy link
Contributor Author

Adding debug is a good idea. I'll also add the trailing comma since consistency is major important, even if this is small. Happy to help out!

@tofumatt
Copy link
Contributor

Thanks for the quick reply 😄

I combined the commits into one just to make things nice and atomic. Merged in 7f210dd.

Cheers!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduce noise in tests
2 participants