Jest crawls FS with `--runTestsByPath` passed
See original GitHub issue🐛 Bug Report
Jest crawls the file system even an exact test file path is specified. Thus, the test run is slower than it could be.
To Reproduce
Open https://github.com/facebook/jest/tree/master/examples/jquery and install dependencies. Run only needed exact test file path to speed up the test run:
jest --runTestsByPath __tests__/fetch_current_user.test.js
Function nodeCrawl
(https://github.com/facebook/jest/blob/v23.6.0/packages/jest-haste-map/src/crawlers/node.js#L130) is called (options.roots
contains the project root).
Expected behavior
The file system is not crawled => faster test run.
Run npx envinfo --preset jest
Paste the results here:
System:
OS: Windows 10
CPU: x64 Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
Binaries:
Yarn: 1.7.0 - C:\Users\Sergey.Simonchik\AppData\Roaming\npm\yarn.CMD
npm: 6.1.0 - C:\Program Files\nodejs\npm.CMD
Issue Analytics
- State:
- Created 5 years ago
- Comments:6
Top Results From Across the Web
Jest CLI Options
If you run Jest via yarn test , you can pass the command line arguments directly as Jest arguments. Instead of: jest -u...
Read more >Jest --runTestsByPath two or more different paths
I'm wondering, because it is not documented anywhere, or answered here on SO, how can I pass two or more different paths to...
Read more >jest-cli | Yarn - Package Manager
Fast interactive mode can switch between running all tests or only test files related to changed files.
Read more >Jest and GitHub Actions. Unit test, end to end test and CI.
This blog post covers Unit tests, end-to-end tests and CI. This article uses Url Pilgrim as a case study. To add unit and...
Read more >Jest CLI Options - w3resource
When you run Jest via yarn test, you can pass the command line arguments as Jest arguments directly. Rather than: jest -u -t="ColorPicker"....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Issue for daemon: #5950.
Closing, but happy to reopen if we’re able to prove that there is a lot of gain to be had by short-circuiting the initial crawl
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. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.