vscode-jest
vscode-jest copied to clipboard
Don't show a debug tag on todo items
Environment
-
node -v
: v14.15.0 -
npm -v
: 6.14.8 -
npm ls jest
: [email protected] -
vscode-jest v4.0.0-alpha.1
-
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.
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.
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:
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.
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.
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
they do get reported with a different icon and summary, so that would make sense.
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 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 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.