-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't work with test.each #55
Comments
hey @zyy7259, i did not consinder this case, will provide support with the next version. |
hey @zyy7259 the issue is that with BUT if you highlight/select the name of the test and right-click - it will not use the parser instead what you actually have seleced. |
created an issue in jest-editor-support |
Hi! I wanted to add that even if related bugs are fixed, I'm having some doubts that it will be possible to fully fix this. The case which would probably not be possible to cover is when placeholders are used in the title of the test, e.g. it.each([
[1, 1, 2],
[1, 2, 3],
[2, 1, 3],
])('wtf %i %i %i', (a, b, expected) => {
expect(a + b).toBe(expected);
}); This will print tests like: And passing a parameter to jest CLI like Is such case something that can be worked around by anything except by highlighting just the 'wtf' part? Highlighting just part of the test title without placeholder parts actually works fine =) |
@PizzaPartyInc thats absolutly correct. but we could probably achieve the something like "-t wtf" without the need of highlighting it, if this can be parsed by the jest parser of jest-editor-support. which means you can just right-click without the need of highlighting. highlighting is more like a fallback if the jest parser fails. this featue has now been implemented in jest-editor-support v28.0.0-beta.0 https://github.com/jest-community/jest-editor-support/releases/tag/v28.0.0-beta.0 Test Example: |
I've confirmed that
|
@Cellule can you try again? looks like this was addressed recently jest-community/jest-editor-support#57 |
Like I said last time, it is already mostly working with v28, however this extension needs to update to it because it's a major version it won't automatically update |
test.each is supported now |
Just tested it and it works perfectly ! Thanks |
Yep! Works nicely! Thanks! it.each([1, 2, 3])('wrap something into quotes: %s', async (num) => {
expect(num).toBe(num);
}); And this throws an error:
PS C:\Project_Name> node "C:\Project_Name/node_modules/jest/bin/jest.js" "C:\Project_Name/test_file.spec.ts" -c "C:\Project_Name/jest.config.js" -t "wrap something into quotes: "(.*?)""
.*? : The term '.*?' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:337
+ ... wrap something into quotes: "(.*?)""
+ ~~~
+ CategoryInfo : ObjectNotFound: (.*?:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException Not sure if having quoted placeholders is a good approach or not... =) |
Right clicking in the body of a test.each and selecting
Run Jest
doesn't trigger jest.The text was updated successfully, but these errors were encountered: