jest icon indicating copy to clipboard operation
jest copied to clipboard

Options to prevent tweaking `console.{log|debug}`?

Open elibarzilay opened this issue 4 years ago • 3 comments

🚀 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.logs 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).

elibarzilay avatar Nov 18 '20 21:11 elibarzilay

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.

github-actions[bot] avatar Feb 25 '22 12:02 github-actions[bot]

activity

elibarzilay avatar Feb 25 '22 13:02 elibarzilay

activity

JESii avatar Sep 09 '22 21:09 JESii

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.

github-actions[bot] avatar Sep 09 '23 22:09 github-actions[bot]

activity

Grundlefleck avatar Sep 09 '23 23:09 Grundlefleck