jest
jest copied to clipboard
Options to prevent tweaking `console.{log|debug}`?
🚀 Feature Proposal
Have a command line flag / config option to avoid touching console.{log|debug}
Motivation
Debugging via console output is often very useful.
Pitch
(This is possibly something that is possible, though I found nothing at all, not on the web and not when asking people.)
I often use console.log
etc to debug code. Should be obvious why it's useful. But for each output, jest shows: a console.debug
line, the actual output, an empty line, a source code location, and another empty line for good measure. Use N console.log
s with M tests, and you have an output messy enough to be either useless or make you go through cumbersome grep/emacs/etc gymnastics.
When trying to see if there's an existing way to get just the output, all I found was some useless SO answers, and #8819 (leading to #9741) which apparently made it worse by adding a separate line for the source location.
I got the vague impression that I can achieve that with a custom reporter, or more test code or whatever -- but I'm just debugging something else, I want to just run it with sane output temporarily while I'm debugging; I don't want to change the test output permanently, and I certainly don't want to diverge into a mini side-project of writing jest code for the occasional debugging need. I also don't want to use an interactive debugger (I have a bunch of similar tests, and I want to eyeball all of them on a single screen rather than stepping through each and every one).
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 14 days.
activity
activity
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days.
activity