-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
describe.each and test.each are shown as 'test result not found' #7
Comments
|
@zxch3n thanks for the info. Are you accepting PR's? If you could just point me to the right file, I could take a look at it :) |
PRs are welcome! But I'm afraid this might not be an easy fix. Because we cannot infer the dynamic test name with 100% correctness from the static text content (which is how this plugin works right now). There are two options left
I'll work on the latter in a week or two, which can also provide watch mode #4 If you are interested you can take a look at |
Thanks for the info, I have investigated this a little and looked into the vitest/ui package because there it works. They are basically connecting to the server like this: When I have more time, I can investigate this a little more. |
Yeah, I think Vitest has an api to communicate with Edit:
Oh, I should have read the next comment 👀 Sorry for ping 👀 |
Maybe this is working now? In my repo the test shows the actual results |
I was still seeing an issue today where the last entry in the each array was undefined when being processed
It didn't matter which value was the last, that value would always become undefined. |
Hi @lampewebdev, the latest version of |
Using the example from the describe.each documentation, I'm still only seeing placeholders rather than the expanded tests. Version: 1.76.1 Vitest extension v0.2.39 |
+1 |
In my case the Would be great to find a way to either support the feature or find a compromise that at least allows to "skip" the test cases containing |
Similar to @dreamorosi i'm trying to use describe.each, it works fince once, and hangs afterwards. Playing around, modifying, saving, stop/start watch, eventually unhangs it and it works well again. i was able to capture this output |
In my case, I'm using the each for If I do like suggested by @langaads, now the extension skips the tests entirely. (EDIT: this happens when clicking "run" on the specific test - when running the parent, it works normally). For reference, this is my test before the change suggested (it hangs): describe('getRequestPaths', () => {
it.each([{ type: 'point' }, { type: 'range' }])(
'it creates the correct request path',
async ({ type }) => {
// do thests
}
);
}); this is my test applying the suggestion (it skips it): describe('getRequestPaths', () => {
it.each([['point', { type: 'point' }], ['range', { type: 'range' }]])(
'it creates the correct request path for %s',
async (name, { type }) => {
// do thests
}
);
}); EDIT: When running or debugging a test that contains a template, the test is skipped. When doing so in the parent it works as expected. At least for now this is an acceptable workaround for me (although it'd still be nice if it worked consistently). Thank you @langaads for the suggestion! |
There is a gotcha. |
Still getting this errors 😢 |
This is now supported in pre-release 0.5.0 and higher. Note that the extension now requires Vitest 1.4.0 or higher. |
Hello,
when usuing
.each
the extension can not find the tests.The text was updated successfully, but these errors were encountered: