-
-
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
22.0.5 - passed folders to jest on CLI are not picked up #5272
Comments
Could potentially be related to a |
toying around with the changes a bit, it seems as if the problem is somewhere in a transitive jest dependency - installing a fixed |
Looks like a problem with #3793 and PR #3882. |
@joscha as a workaround, if you use yarn you can use |
For cross-reference, I've suggested changes in this comment on #3793 and would appreciate feedback. It's a great issue for anyone looking to contribute. I'll have a go later this week if I find some "spare" time. |
Just for extra context to support we've encountered this bumping up from jest
We pass a directory ( There is a single output of the following error message:
|
I had to downgrade to the following jest packages:
|
If your tests are in a directory e.g. Perhaps it should be documented more explicitly that it's required to pass a glob pattern that matches test files rather than specifying a test directory, assuming it will recursively search that directory for test files. |
The directory not being picked up is a regression and wouldn't need to be documented. The PR that introduced the change, #3882, did add a bit of a twist to the file matching though. If a file exists it will be considered a test, regardless if it matches the |
yes, although the import pattern is different for each project and it would be quite a chore to add it - we pick up folders vaild for tests with a glob in bash, e.g. the non-simpliefied invocation of jest looks like this: shopt -s extglob
yarn jest -- \
--collectCoverageFrom='src/**/*' \
--collectCoverageFrom='!src/pages/**/*' \
--collectCoverageFrom='!src/ui/**/*' \
conf tools src/!(pages|ui) src/pages/!(editor|templates)/ ideally I would not need to post-process:
and add every pattern in I will do it, if this "change" (which is a regression in my eyes), is the new default, but I'd hope we find a fix for this behaviour instead. |
I too am receiving this error now with
Now I am using this workaround:
If it helps anyone else... |
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. |
Do you want to request a feature or report a bug?
bug
What is the current behavior?
A CLI run which worked before (22.0.4):
running tests from
conf
,tools
,src/base
, ...now fails in 22.0.5:
If the current behavior is a bug, please provide the steps to reproduce and
either a repl.it demo through https://repl.it/languages/jest or a minimal
repository on GitHub that we can
yarn install
andyarn test
.repl.it is at 20.0.4 and won't have the same problem.
Repository is here: https://github.com/joscha/jest-2205-folders
What is the expected behavior?
The tests are run.
Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.
node v8.9.4
jest 22.0.5
yarn 0.27.5
OSX Sierra but also fails on CI which is a Linux
The text was updated successfully, but these errors were encountered: