-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
App uninstalls and reinstalls for every test file when using Jest #1279
Comments
Just a wild suggestion - do you run with At the moment I'm not sure how to do that exactly, but in your shoes, I'd try my luck with https://jestjs.io/docs/en/configuration#globalsetup-string, do you agree? Is there a blocker from Detox side preventing using globalSetup? |
@noomorph Problem with How exactly would globalSetup help with the issue? What would I be doing in the globalSetup? |
@HammadJ , I suggest to reinstall the app on the emulator/simulator in a global setup. To stop reinstalling on each suite run, make sure to follow this: |
We use the issue tracker exclusively for bug reports and feature requests. This issue appears to be a general usage or support question. Instead, please ask a question on Stack Overflow with the |
I am reopening the issue just to explain what I know about this behaviour. The nature of Jest as a multiworker test runner is causing this behaviour. The test runner is spinning up workers, and dispatching jobs (in that case, test files) to each of them. AFAIK, there is no way to configure an env setup file per worker, only per test file.
@noomorph, your suggested idea is interesting, but again, there's no lifecycle hook for per-worker startup AFAIK, therefore any setup solution with Jest will be limited. |
@HammadJ, could you please create a feature request for support of single reinstall in multi worker mode? We'll continue the discussion there. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
The issue has been closed for inactivity. |
Describe the bug
After refactoring our tests to use Jest instead of Mocha, Detox started uninstalling / reinstalling the app for every test file. This greatly slows down our tests and is not ideal.
To Reproduce
Any Detox setup with Jest will exhibit this behaviour while Mocha setups will not.
Expected behavior
The app should not be reinstalled for every test file unless the user tells detox to do so.
Environment (please complete the following information):
Device and Verbose Detox Logs
Example of it reinstalling between tests
The text was updated successfully, but these errors were encountered: