-
-
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
Make jasmine.DEFAULT_TIMEOUT_INTERVAL configurable #652
Comments
👍 |
I think it is enough to set this on a per-test level. This already works. If you need it in every test you can set it in the setup-env file. |
@cpojer Where / how? |
Sorry, I mean the |
Thanks for the clarification. I my setupfile, I tried setting I can only access jasmine from "setupTestFrameworkScriptFile". |
Phew, I'm sorry again. |
These docs apparently don't exist anymore. How can I configure that timeout interval in the current version? |
Somebody should send a PR for |
May I suggest improving the API reference and troubleshooting section in the docs to indicate that Jasmine's |
While this issue is closed, I just ran into it as well, and couldn't figure out a solution. Nothing in here nor in #896 helped. Specifically, adding
I tried that, too, but it didn't make any difference. |
@jzaefferer Add it to the test file itself |
5000 works well as a global config, if you want to change the timeout for a specific test, please do this
|
@sudhanshuraheja thanks, that works ;) although I found a way to avoid doing that altogether |
@phil-r care to share with the rest of the class? 😄 |
@warent I don't remember exactly what the issue was, but I wasn't using fake timers correctly. After I fixed the issue with fake timers in my test, there was no need for increased timeout. |
So what's the correct way of setting timeouts globally? The URLs in this issue are obsolete |
@benjick Per https://facebook.github.io/jest/docs/en/troubleshooting.html#unresolved-promises jest.setTimeout(10000); // 10 second timeout I do this in a setup file (https://facebook.github.io/jest/docs/en/configuration.html#setupfiles-array) |
Thanks for that @jordansexton, just a note though, it doesn't seem to work if using the |
future references, this worked for me |
Yep that's what I did as well |
@sudhanshuraheja Thanks for the tip! |
This comment has been minimized.
This comment has been minimized.
|
to the |
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. |
5 seconds can be really annoying if you have many test cases that fail.
I'm not sure what would be the best option to accomplish this, but I imagine a configurable option in
package.json
. Something likedefaultTimeoutInterval
, which would then be passed to jasmine used.Steps:
jasmine.DEFAULT_TIMEOUT_INTERVAL
tojestConfig.defaultTimeoutInterval || 5000
The text was updated successfully, but these errors were encountered: