-
-
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
Is jest fully scanning node_modules and then ignoring its content by default ? #9862
Comments
I'm wondering whether |
what is the right configuration in monorepo to improve this? |
I'm certain this is what I'm seeing right now.
This is causing around a 30s run for a single test file in describe('simple', () => {
it('should be sane', () => {
expect(false).not.toBe(true);
});
}); |
Just figured out how it works and it's a sad story.. 😞 First it checks if you have and if not... it either uses native find (your usecase @jufemaiz ) for all files in or if |
And the worst part is that all this Jest do completely silently.. No message like "Hey install watchman" or "Warning: Native find is not available on your system".. |
is it much faster using watchman? |
In our project, with watchman, startup time is almost instantaneous. |
Sounds like having a warning on the console output would be a good improvement. |
Definitely @fungiboletus ! |
Also worth mentioning that last saved index must be available in jest cache and cache key must be valid otherwise it builds index again. And completely agree that it should be evident from CLI that indexing is happening and in documentation I think it should be stated how to avoid it. From
|
Is the startup time going only up when you are actually running in watch mode or is it sufficient to have watchman installed? We have a quite big mono repo with > 3k tests and quite some dependencies. It takes 20-40s for jest to actually start a test run. |
See also this config change for watchman so that it ignores node_modules. That speeds up the initial run significantly: #10833 (comment) |
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days. |
Dear GitHub bot, please hear my plea, So please ask the one who set you up, |
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days. |
. |
⚡ Performance improvement ?
Jest has been slow to start on my computer, which has a relatively slow filesystem (windows ntfs and a few layers of encryption).
Reading the default configuration, I'm wondering whether jest scans every file in the
<rootDir>
and then ignores the ones in node_modules. I replaced my roots with<rootDir>/src/
instead of<rootDir>
and it feels faster.To Reproduce
roots: ['<rootDir>/src/']
in its config.Expected behavior
Jest should scan the files to find the tests relatively fast. But by default I'm not sure it's the case.
envinfo
The text was updated successfully, but these errors were encountered: