-
Notifications
You must be signed in to change notification settings - Fork 384
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
JEST - Test Nearest
on tests that has .each()
does not work
#672
Comments
Could you please confirm if this is still an issue after updating to the latest version of the plug-in |
I'll check it out next monday when I'm back at work!! Looking forward to experience the bug fix!! Thank you |
@codeinabox it seems like they're not working. I have tests that are:
|
Thank you for checking, so to confirm TestNearest is being called on the lines where you have "<----------TEST THIS"? |
@codeinabox that's correct. I just pulled down the latest update on vim-test, and apparently there was a fix around playwright test #682. When I tested, it looks like it is half working. The test at least doesn't skip anymore, however, only a single test runs. For example,
will only run for the |
Given I have these tests:
The test SKIPS.
The test SKIPS. The |
same issue for me, do you guys have any update? |
Thank you for all these examples that aren't working properly, we should add them to the spec for Jest so this issue can be resolved. I am pretty flat out these days, though if I find time I'll look into it. |
Thanks so much! Wish i could be more helpful to contribute but I'm not too familiar with vim script..😅 |
I see the issue now, any each test using the printf notation isn't going to run because the currently generated regex won't match. Given the earlier example you provided: describe.each([1,2])('Given %d' , (number)=>{
it.each(['a','b'])(' should print %s', (string)=>{
expect(number).toBe(number); // <---------- TEST THIS
expect(string).toBe(string);
})
}) The generated regex is currently However, converting the printf expressions into a flexible enough regex could get quite complicated. A simple fix would be to truncate the regex the moment it encounters any printf expressions, for example |
That makes sense. Looking forward too try out the patch when it's fixed..! |
Just remembered this, as I've run into a similar issue with Vitest, so I will try to pick this up again. |
@codeinabox thanks so much! I've been waiting on this..! |
When you have jest tests;
describe.each([1, 2 ])('Loop the test with given array',()=>{})
it.each([1, 2 ])('Loop the test with given array',()=>{})
test.each([1, 2 ])('Loop the test with given array',()=>{})
the functionality of "Test Nearest" does not work and skips the test.
The text was updated successfully, but these errors were encountered: