-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Add timeouts to test.each
implementations
#6749
Comments
We have an open PR for this 🙂 #6660 |
thymikee
pushed a commit
that referenced
this issue
Aug 9, 2018
## Summary Add test/describe timeout support - Fixes feature parity to [testname-fn-timeout](https://jestjs.io/docs/en/api#testname-fn-timeout) etc Fixes #6749 ## Test plan - Updated `jest-each` unit tests - Remove duplicate unit tests in `jest-jasmine2` (we have integration tests that cover this so no need to maintain the unit tests in two places)
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
🚀 Feature Proposal
As of right now, you can set the timeout for an individual
test()
invocation by setting thetimeout
parameter to the number of milliseconds you want a test to run. It is well documented here. However, that functionality is lacking fortest.each()
. I propose thattest.each()
is updated such that if you pass a timeout to its third argument, it sets a timeout for each iteration of the test as it does for the individualtest()
.Motivation
The consumer of Jest will have a more consistent API for
test()
andtest.each()
implementations, where the latter is merely a parameterized version of the former.Example
I have an integration test that converts pdfs into images at various "chunk sizes", ensuring that only a specific number of pages are being converted at a time in order to prevent the conversion process from consuming too many resources. However, the end result should always be the same regardless of "chunk size." This particular test requires converting images and regularly takes more than 5 seconds. It should take less time than my failure cases which should return almost instantly.
Pitch
(Why does this feature belong in the Jest core platform?)
It already exists within the Jest core platform! :) I actually expected it to be there when I worked with the framework. Today, since there is no error if you set the timeout on a
test.each
implementation, Jest fails with a timeout of 5s as it does by default, and you have to look at the documentation to see that it actually isn't supported for parameterized tests as it is for individual ones. I think this is a clear cut situation where expectations and reality clash.The text was updated successfully, but these errors were encountered: