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

feat: add parameter for test name of each #1031

Merged
merged 5 commits into from Mar 26, 2022
Merged

Conversation

ouduidui
Copy link
Contributor

I want to supplement a parameter about index of the test case for test name of each.

test.each([
  [1, 1, 2],
  [1, 2, 3],
  [2, 1, 3],
])('the index of the test case is %#', (a, b, expected) => {
  expect(a + b).toBe(expected)
})

// this will return
// √ the index of the test case is 0
// √ the index of the test case is 1
// √ the index of the test case is 2

@netlify
Copy link

netlify bot commented Mar 26, 2022

Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit c53ea4c
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/623ef3eb4728ec00088e4149
😎 Deploy Preview https://deploy-preview-1031--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@antfu antfu merged commit 4210c39 into vitest-dev:main Mar 26, 2022
@ouduidui ouduidui deleted the docs-feat branch March 26, 2022 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants