-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Feature] support for (it|test|describe).each(...)
#120
Comments
This was also requested by @userquin in the EPIC issue. We were talking with Anthony that What I told to @userquin, and maybe someone else wants to take this one, is that 1. it may be good to wait until the internals are more stable to avoid the need to refactor this feature while the code is stabilizing and 2. we could discuss with a PR implementing it, because maybe the added complexity isn't that big at the end. In case we don't want to support tabular output in the reporter, maybe we could implement |
Would be awesome! 🙏 I've just tested migrating some of my smaller repos from Jest to Vitest, and found [only!] 2 broken things:
|
15 minutes after writing last comment, managed to "money-patch" the missing export function testEach(cases: any[][]): (name: string, fn: AnyFunction) => void {
return (name, fn) => {
cases.forEach(items => {
test(name, () => fn(...items))
})
}
} |
I tried the solution shared by @kirillgroshkov and found that though my tests passed, they weren't actually running. I tried using really basic sanity checks like Two thoughts on my mind:
EDIT: I got this to work. In my case, I had to switch |
e.g That would explain why you go no failures of basic checks. |
Would like this request to cover |
(it|test).each(...)
(it|test|describe).each(...)
Thank you very much! I was asking for this feature just today on Discord. Highly appreciated!!! |
I was migrating MermaidJS to vitest and needed template literal support. https://gist.github.com/sidharthv96/80cc25016d94b6f6590dec89e6586c64 |
Jest supports
it.each
: https://jestjs.io/docs/api#testeachtablename-fn-timeout with an array or a template table.The text was updated successfully, but these errors were encountered: