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

Vitest conventions #11

Closed
brandonjpierce opened this issue May 29, 2024 · 2 comments · Fixed by #108
Closed

Vitest conventions #11

brandonjpierce opened this issue May 29, 2024 · 2 comments · Fixed by #108
Assignees
Labels
test Adding missing tests or correcting existing tests

Comments

@brandonjpierce
Copy link
Contributor

A common pattern we have is doing something like:

const pairs = [
  ['test title', 123],
  ['test title', 123],
  ['test title', 123],
  ['test title', 123],
]

it('the test', () => {
  for (const pair of pairs) {
    expect(pair[1]).toEqual(123);
  } 
});

However, vitest does have it.each which works on pairs like datasets. Should we switch to that method instead?

@brandonjpierce
Copy link
Contributor Author

Perhaps move this to a discussion instead

@belsrc
Copy link
Contributor

belsrc commented Jul 23, 2024

It also has ... which is what I prefer to use.

describe('description...', () => {
  for (const [a, b] of TESTS) {
    it.concurrent( ... )
  }
}

https://vitest.dev/api/#test-concurrent

Additionally, can mark the entire inner describe as well.
https://vitest.dev/api/#describe-concurrent

@belsrc belsrc changed the title TODO: vitest conventions Vitest conventions Nov 17, 2024
@belsrc belsrc added the test Adding missing tests or correcting existing tests label Nov 17, 2024
@kalisjoshua kalisjoshua self-assigned this Nov 20, 2024
kalisjoshua added a commit that referenced this issue Nov 20, 2024
additionally clean up folder names for fixtures.

issue #11
@kalisjoshua kalisjoshua linked a pull request Nov 20, 2024 that will close this issue
7 tasks
kalisjoshua added a commit that referenced this issue Nov 20, 2024
additionally clean up folder names for fixtures.

closes #11
closes #77
kalisjoshua added a commit that referenced this issue Nov 21, 2024
additionally clean up folder names for fixtures.

closes #11
closes #77
kalisjoshua added a commit that referenced this issue Nov 21, 2024
additionally clean up folder names for fixtures.

closes #11
closes #77
kalisjoshua added a commit that referenced this issue Nov 21, 2024
additionally clean up folder names for fixtures.

closes #11
closes #77
kalisjoshua added a commit that referenced this issue Nov 22, 2024
@kalisjoshua kalisjoshua linked a pull request Nov 22, 2024 that will close this issue
7 tasks
kalisjoshua added a commit that referenced this issue Dec 2, 2024
kalisjoshua added a commit that referenced this issue Dec 3, 2024
kalisjoshua added a commit that referenced this issue Dec 3, 2024
kalisjoshua added a commit that referenced this issue Dec 3, 2024
kalisjoshua added a commit that referenced this issue Dec 4, 2024
kalisjoshua added a commit that referenced this issue Dec 18, 2024
kalisjoshua added a commit that referenced this issue Dec 18, 2024
kalisjoshua added a commit that referenced this issue Dec 18, 2024
kalisjoshua added a commit that referenced this issue Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Adding missing tests or correcting existing tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants