feat: Console output test util#1370
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1370 +/- ##
=======================================
Coverage 45.55% 45.55%
=======================================
Files 506 506
Lines 34889 34895 +6
Branches 8709 8710 +1
=======================================
+ Hits 15892 15898 +6
Misses 18946 18946
Partials 51 51
Flags with carried forward coverage won't be shown. Click here to find out more.
|
| /** | ||
| * Selectively disable logging methods on `console` object. Uses spyOn so that | ||
| * changes will be reverted after leaving the test scope that it is set in. If | ||
| * no method names are given, all will be disabled. | ||
| */ |
There was a problem hiding this comment.
I would maybe change this to a single param that takes an array and then clarify the intention w/ @param methodNames The console methods to disable
There was a problem hiding this comment.
The main benefit would be adding params in the future is easier if needed, but I don't expect this to be used too often.
I think part of my tendency also stems from before ...rest existed and you had to use arguments as a magic value if you wanted to use variadic functions
There was a problem hiding this comment.
I'll probably just add the jsdoc on this one and leave the rest param unless you feel strongly otherwise
|
Do you have a specific example for using this right now? Is it just to disable 3rd party logging like react warning about unmounting component lifecycles? Our log package should be silent during tests by default |
|
There are a few prop type warning / errors in existing tests which might be good candidates. The specific use case though is in |

Console output test util
resolves #1369