-
-
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
transform not applied to file in parent directory #8238
Comments
I tried adding |
Any updates on this? Sharing libraries in a monorepo is a pretty common scenario, and Node v12 has also re-affirmed that I've copied Installing the No amount of tweaking I did find a workaround, but I don't understand why the original babel config from |
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. |
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
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. |
🐛 Bug Report
I'm using Jest with
.mjs
files andbabel-plugin-transform-es2015-modules-commonjs
in a monorepo with several projects:backend
,client
etc. The projects share a commonlib
folder.In test files located in
backend
, importing modules frombackend
or a subdirectory of it works fine. Importing from the../lib/
directory however, causes Jest to fail withJest encountered an unexpected token / SyntaxError: Unexpected token export
.To Reproduce
monorepo/backend/package.json
monorepo/backend/lib/backend-lib.mjs
monorepo/backend/use-backend-lib.test.mjs
*monorepo/lib/project-lib.mjs
monorepo/backend/use-project-lib.test.mjs
Steps to reproduce the behavior:
git clone [email protected]:dandv/jest-parent-dir-transform.git
cd jest-parent-dir-transform/backend
git checkout 50a49bc
npm install
npm test
Expected behavior
Both tests pass
Link to repl or repo (highly encouraged)
https://github.com/dandv/jest-parent-dir-transform at commit #50a49bc
Run
npx envinfo --preset jest
System: OS: Linux 4.15 Ubuntu 18.04.2 LTS (Bionic Beaver) CPU: (8) x64 Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz Binaries: Node: 11.12.0 - /usr/bin/node Yarn: 1.15.2 - /usr/bin/yarn npm: 6.9.0 - /usr/bin/npm npmPackages: jest: ^24.5.0 => 24.5.0
The text was updated successfully, but these errors were encountered: