Skip to content
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 support creating tests with forEach loop #163

Closed
selfrefactor opened this issue Jun 14, 2023 · 3 comments
Closed

Doesn't support creating tests with forEach loop #163

selfrefactor opened this issue Jun 14, 2023 · 3 comments
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@selfrefactor
Copy link

It simply skips the tests when I request a run, even though tests are shown.
I think this is valid use case, as it is normal to want to apply DRY in our unit tests:

const TEST_DATA = [
  {label: 'episode', key: 'TEST-1'},
  {label: 'season', key: 'TEST-2'},
]

TEST_DATA.forEach(({label, key}) => {
  test(`with ${label}`, () => {
    let {item, level} = foo(getTestTreeData(), key)
    expect(item[ID]).toBe(key)
  })
})
@selfrefactor selfrefactor added the p3-minor-bug An edge case that only affects very specific usage (priority) label Jun 14, 2023
@tjx666
Copy link

tjx666 commented Jun 15, 2023

same here: https://github.com/tjx666/leetcode-javascript-2023/tree/main

2023-06-15.15.04.30.mov

@eavidy
Copy link

eavidy commented Aug 2, 2023

forEach is similar to test.each
Similar issue: #7

@sheremet-va
Copy link
Member

This should be fixed in pre-release 0.5.0 and higher. Note that the extension now requires Vitest 1.4.0 or higher.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

No branches or pull requests

4 participants