-
-
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
Defining test timeout as a config parameter #6216
Comments
Makes sense. Should the name be |
I was taking that into consideration, and just decided to go |
Could this parameter be added to the CLI as well? Reason for this is that when I use a debugger to step through code, I would like to set it to infinite (or very high). But I don't want to change this setting in our config, because then this change might be committed by accident... Or is it possible to point to a different config via another cli parameter? |
Having a flag like 'disable timeouts' on the cli to help debugging makes more sense to me than being able to set a timeout |
I can't believe this doesn't exist? How is it even possible to use a step debugger if every test times out after 5s? |
So still no way to set default timeout value ? |
@bluedusk you can always just drop somewhere |
I think that users should be able to:
@thymikee what do you think about it? I can try implementing these. |
@SimenB @krzkaczor so we could have a single |
@thymikee I think |
Anyone working on this issue? If no, I pick up. |
@ert78gb Is this issue covered by your PR? |
Yes and it is landed in 24.9.0 |
Looks like we can close this :) |
I am confused as to what this is supposed to do. I tried the config like this: module.exports = {
verbose: true
projects: [
{
displayName: 'E2E',
preset: 'jest-playwright-preset',
rootDir: 'tests/',
testTimeout: 100,
setupFilesAfterEnv: [
'<rootDir>/jest.setup.js',
],
},
],
}; I have tests taking more than 100 ms obviously, but it still does not time out in any way. How come? And what is the difference between the config |
It can be described both as 'per test' and 'per test file' - using |
Good info! I have one since before, I suppose I should take one for the team and try to push a PR. I'm running tests in asynchronous operations. Setting |
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. |
🚀 Feature Proposal
I'd like to propose introducing a new config parameter config called
timeout
, that would accept a number or a string.Motivation
To set a global timeout different than Jest's default, one must use a
setupTestFrameworkScriptFile
config and create a new file. This is a bit cumbersome, isn't it?It would also play nice with the API we have for already:
jest.setTimeout(number)
.Example
Pitch
Why does this feature belong in the
Jest core platform?
It is a config change, duh.
The text was updated successfully, but these errors were encountered: