-
Notifications
You must be signed in to change notification settings - Fork 6
node_jest_test: Couldn't find preset "es2015" relative to directory #4
Comments
@gfl-chris I ended up simplifying the jest_test rules for now and you can get them directly from master: https://github.com/ecosia/bazel_rules_nodejs_contrib/blob/master/internal/jest_node_test/defs.bzl I might change them later on, but for now they have been working well for us. the second problem we have started running into is that the So what we have done to workaround this issue is using this paclage: https://github.com/ds300/patch-package we are patching our jest via yarn. You can find the patches for jest 24.5.0 here: https://gist.github.com/Globegitter/ef72bba83e12a21480f33be22877a641 Also interestingly, I have not noticed the option The last thing with babel-jest/babel, to have babel work correctly with bazel you will need to configure it via the
That is because per default babel also uses its own require method so will otherwise not find the plugins/presets. Hope that helps. Let me know if you still run into any issues. |
Unfortunately |
Hmm, it should invoke them. We are using
Also you have tell bazel to provide the patch files to yarn/npm via
in our |
@gfl-chris Any success with that? |
We talked on Slack that the issue has been resolved now. |
Here is an updated set of jest patches for |
This PR adds an example of how you might create a Jest rule Unfortunately Jest does not handle symlinks very well so we have to add some patches so that it behaves correctly(See: jasongwartz/bazel_rules_nodejs_contrib#4 (comment))
This PR adds an example of how you might create a Jest rule Unfortunately Jest does not handle symlinks very well so we have to add some patches so that it behaves correctly(See: jasongwartz/bazel_rules_nodejs_contrib#4 (comment))
* feat(examples): add Jest example This PR adds an example of how you might create a Jest rule Unfortunately Jest does not handle symlinks very well so we have to add some patches so that it behaves correctly(See: jasongwartz/bazel_rules_nodejs_contrib#4 (comment)) Ultimately we should be able to move these patches into bazel_require_script which globally patches symlink operations for all node programs run by Bazel.
I'm trying to use node_jest_test (from the
jest_rules
branch) to run our test suite. Here's the rule in our BUILD file (some names changed to protect the innocent):where
//my_project/frontend:tests
is a glob for all*.test.js
files and//my_project/frontend:frontend
is a glob for all files. Here's myjest.json
:It tries to run the tests, but every test fails with the following trace:
I've tried a bunch of different version of
jest
andbabel-jest
(20.0.3 and 23.2.0), but no luck. Any suggestions? :|The text was updated successfully, but these errors were encountered: