Skip to content

Conversation

andrewhillcode
Copy link
Contributor

What:

Add a new config value called asyncUtilTimeout to allow users to adjust the default timeout for the async utils.

Why:

There doesn't seem to be a nice way to change all of the async utils to use something other than 4500 timeout by default. This is useful for those who have changed the default jest timeout that the 4500 value was intended to be used with.

Checklist:

  • Documentation added to the
    docs site
  • Typescript definitions updated
  • Tests
  • Ready to be merged

@alexkrolick
Copy link
Collaborator

I'm for this

@afontcu
Copy link
Member

afontcu commented Aug 16, 2019

Looks like a nice addition 👍

Quick question: what would happen if someone set a greater value than Jest's timeout? I guess DTL could warn user about that scenario.

FWIW, default value is 5000 and can be set using jest.setTimeout() (source).

@andrewhillcode
Copy link
Contributor Author

Yeah I didn't think about the user increasing the timeout above Jest's. The DTL docs already mention that Jest's timeout is 5000 (which is why the DTL default is 4500).

Does this need more warnings than what is already on the docs? I plan to mention Jest's default when updating the config page to include asyncUtilTimeout

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine to merge this as-is as an undocumented feature (I don't think it'll be very widely used). If we do end up documenting it, then we should also find a way to provide a warning for people if they try to set this to greater than the jest timeout.

@kentcdodds kentcdodds merged commit 1bd90b1 into testing-library:master Aug 16, 2019
@kentcdodds
Copy link
Member

@all-contributors please add @andrewhillcode for code

@allcontributors
Copy link
Contributor

@kentcdodds

I've put up a pull request to add @andrewhillcode! 🎉

@kentcdodds
Copy link
Member

🎉 This PR is included in version 6.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@andrewhillcode
Copy link
Contributor Author

Cool, thanks Kent :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants