Skip to content
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

jest.setTimeout is not a function #36

Open
perrin4869 opened this issue May 10, 2022 · 1 comment
Open

jest.setTimeout is not a function #36

perrin4869 opened this issue May 10, 2022 · 1 comment

Comments

@perrin4869
Copy link

I've been trying to migrate a module to using this test runner (thank you so much!).
Unfortunately I got stuck behind an error: TypeError: jest.setTimeout is not a function
I am not sure if this is a problem in this repo to be honest, but suspect it might not be supported here? If so, is there an alternative?
Thanks!

@Zikoat
Copy link
Contributor

Zikoat commented Nov 22, 2022

The fix in my case was to just remove the call to jest.setTimeout and let the test run.

In the normal jest runner the test fails after 5 seconds, and then you have to run jest.setTimeout(20 * 1000) to make it run for 20 seconds before failing.
In jest-light-runner the behavior is to not fail the test after 5 seconds, but to keep it running indefinitely until it resolves. Just removing the call to jest.setTimeout is a temporary fix, but this might break the pipeline if there are some promises that never resolve.

Having a promise that never resolves might happen if the test is run as an integration test, and an update in the test causes a deadlock in the database. In this case the test will never fail, and if it additionally is run in the pipeline it will keep the pipeline from completing. So it would be nice if this feature would be implemented, or that this different behavior is at least documented in the readme.

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

No branches or pull requests

2 participants