vscode-jest icon indicating copy to clipboard operation
vscode-jest copied to clipboard

Don't show a debug tag on todo items

Open pmcelhaney opened this issue 4 years ago • 8 comments

Environment

  1. node -v: v14.15.0

  2. npm -v: 6.14.8

  3. npm ls jest: [email protected]

  4. vscode-jest v4.0.0-alpha.1

  5. OS X

Prerequisite

Everything works fine, this is more of a feature request.

Steps to Reproduce

Create a "todo" task.

it.todo('renders a single input and add button by default');

Actual Behavior

The debug tag is added, even though there's nothing to debug. image

Expected Behavior

No "debug" tag over todo tests.


The fastest (and the most fun) way to resolve the issue is to submit a pull-request yourself. If you are interested, feel free to check out the contribution guide, we look forward to seeing your PR...

Yep, that's my intent. Not today, but later when I have time. This seems like a good place to get my feet wet.

pmcelhaney avatar Nov 11 '20 13:11 pmcelhaney

I am hitting this too and it gets quite annoying as, when you start filling out the first of a long list of it.todo tests, the debug tags are now in the wrong place and end up getting in between every line of the new code: image

markcarroll avatar Dec 03 '20 21:12 markcarroll

Poking around the code on my phone, I found the config for which test types should have the debug code lens.

https://github.com/jest-community/vscode-jest/blob/c8ba11e81edc471bb44d8a212c937c8cbbdff7d9/package.json#L146

Note that “todo” is not in the list, but there’s no categorization for todo.

pmcelhaney avatar Jan 24 '21 16:01 pmcelhaney

Okay, it looks like "pending" (todo) results are tagged as "KnownSkip".

https://github.com/jest-community/jest-editor-support/blob/2f74cee697b4efc6f75f6e7678a7ca785acb25d5/src/test_reconciler.js#L132

Pending (it.todo) is not the same as skipped (it.skip). I'm pretty sure todo is a relatively recent addition to Jest so we may need to update some places to support it.

pmcelhaney avatar Jan 24 '21 17:01 pmcelhaney

Maybe "pending" does mean skipped. This makes it look lime there's a status named "todo".

https://github.com/facebook/jest/blob/d00695d176ea948954c1df7a1f7208a2c788d923/packages/jest-reporters/src/VerboseReporter.ts#L103

pmcelhaney avatar Jan 24 '21 17:01 pmcelhaney

they do get reported with a different icon and summary, so that would make sense.

markcarroll avatar Jan 25 '21 03:01 markcarroll

Yeah, I don't think it will be hard to fix. I have next week off work so I'll look at it then.

pmcelhaney avatar Jan 25 '21 13:01 pmcelhaney

@pmcelhaney that is great! You will probably need to fix both jest-editor-support and then this extension. Let me know if you have any questions.

connectdotz avatar Jan 25 '21 23:01 connectdotz

@connectdotz I created two PRs, jest-community/jest-editor-support#61 and #659. I'm not sure where I went wrong with the second PR, but now I'm not seeing the debug tag above any tests.

pmcelhaney avatar Feb 04 '21 17:02 pmcelhaney