-
Notifications
You must be signed in to change notification settings - Fork 522
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_test
fails to locate test files (when used with ts_project
?)
#2338
Comments
I noticed something else today. Perhaps this is of diagnostic value: chrislane@Chris-Lane’s-MacBook-Pro:/Volumes/dev/jest-test-repro/bazel-bin/ts/lib/greet/ts_greet_test.sh.runfiles/com_github_sharpspring_jest_test_repro/ts/lib/greet (fix-attempts)$ ./ts_greet_test.sh
ERROR: cannot find build_bazel_rules_nodejs/third_party/github.com/bazelbuild/bazel/tools/bash/runfiles/runfiles.bash It seems that
But not here:
|
It appears that the root cause of the problem is that Upon making that discovery, my team was able to develop a workaround to the problem: With that said, I'll leave it to the maintainers' discretion whether or not to close this ticket. |
That's what this patch is for https://github.com/bazelbuild/rules_nodejs/blob/stable/examples/jest/patches/jest-haste-map%2B24.9.0.patch - do you have this patch included in your repo? Note we are still hoping Jest will fix it upstream jestjs/jest#9351 |
Hi, @alexeagle We did not use that patch for a few reasons:
+1 for this. I do feel that this is best resolved upstream rather than within That said, perhaps we could improve the documentation here? I'm willing to work up a PR, if you agree that there is a need. Either way, our specific problem is now resolved. Feel free to close this ticket if you believe there is no further action necessary. Thanks very much for your time. |
yes I'd love a PR against the docs to help prevent another user falling into the same hole.
|
Sounds great. I'll work one up 👍 |
It would be great to have a macro example for typescript. |
This issue has been automatically marked as stale because it has not had any activity for 90 days. It will be closed if no further activity occurs in two weeks. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs! |
Seems jestjs/jest#9351 landed in jest@27.0.0, Maybe the patch can be removed in examples? |
replace the patch with setting enableSymlinks to true. ref: bazel-contrib#2338
replace the patch with setting enableSymlinks to true. ref: bazel-contrib#2338
replace the patch with setting enableSymlinks to true. ref: bazel-contrib#2338
replace the patch with setting enableSymlinks to true. ref: #2338
replace the patch with setting enableSymlinks to true. ref: #2338
This issue has been automatically marked as stale because it has not had any activity for 90 days. It will be closed if no further activity occurs in two weeks. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs! |
not stale |
This issue has been automatically marked as stale because it has not had any activity for 90 days. It will be closed if no further activity occurs in two weeks. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs! |
not stale |
Jest 27 includes the fix for finding test that as symlinks which is required to work under bazel. The minimal repo test failure https://github.com/sharpspring/jest-test-repro can be resolved with the following changes:
(plus the corresponding |
replace the patch with setting enableSymlinks to true. ref: bazel-contrib#2338
This issue has been automatically marked as stale because it has not had any activity for 6 months. It will be closed if no further activity occurs in 30 days. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs! |
not stale |
@jakeleventhal can you still repro after upgrading jest and adding the haste config? |
This issue has been automatically marked as stale because it has not had any activity for 6 months. It will be closed if no further activity occurs in 30 days. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs! |
not stale |
This issue has been automatically marked as stale because it has not had any activity for 6 months. It will be closed if no further activity occurs in 30 days. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs! |
This issue was automatically closed because it went 30 days without any activity since it was labeled "Can Close?" |
🐞 bug report
Affected Rule
The issue likely pertains to
jest_test
, and possibly tots_project
.Is this a regression?
Unknown.
Description
I am encounting surprising behavior when using
jest_test
withts_project
, and suspect I may have encountered a bug inrules_node
.I am attempting to create a TypeScript monorepo that utilizes
jest
for testing. I've been modelling my work after the jest examples, though I'm attempting to usets_project
instead ofts_library
, as I've read that the former is preferred. With that said,bazel test ...
is not performing as expected.My project builds and runs successfully. However, when I run
bazel test ...
,jest
appears to be unable to locate test files.I had suspected that this was due to a configuration error on my part. I have discovered, however, that the tests pass when run as follows:
(
ts_greet_test
is the name of the test in question.)Given that the
ts_greet_test.sh
file is (I believe) machine-generated, can this problem still be a mistake on my part, or may I have encountered an issue withjest_test
(and perhapsts_project
)?🔬 Minimal Reproduction
A minimal reproduction is available here:
https://github.com/sharpspring/jest-test-repro
🔥 Exception or Error
Verbose logs are available here:
https://gist.github.com/chrisallenlane/1058a1001d1b89032ceecdc5fa89bb7c
🌍 Your Environment
Operating System:
Output of
bazel version
:Rules_nodejs version:
Anything else relevant?
I am relatively new to
bazel
, and apologize if I've missed anything obvious here.Thanks very much for your help.
The text was updated successfully, but these errors were encountered: