-
Notifications
You must be signed in to change notification settings - Fork 94
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 crash when using cds-plugin-ui5
#901
Comments
Hmm, I think this can't be fixed easily in the Jest issue (one of them): jestjs/jest#12286 After upgrading my local nodejs to 21 and using the following command line: NODE_OPTIONS=--experimental-vm-modules jest tests/test.js it works... I have to admit, that I can't help here and this needs to be fixed using a newer Node.js version plus enabling the ESM support for JEST: https://jestjs.io/docs/ecmascript-modules Sorry... I think this has to be documented and therefore I'll keep it open. The try of Volker with #903 will not work... I'll close the PR and keep the issue open to add the documentation... |
The JEST tests are only used for the backend tests, right? In this case we may disable it exactly with the parameters @vobu used in his #903 PR to switch to require. I think this makes sense and can be done easily. WDYT? If it is only the backend tests - I'm fine and will prepare a change (and I would allow to force to enable the plugin for testing purposes with the suggestion of using Node.js 21 and the experimental support for ESM)... |
Exactly right - the ui5 apps are not required for cds.test() etc. If there was a simple switch to completely bypass the plugin that would be perfect. Eg. CAP_PLUGIN_BYPASS=true jest |
@js1972 - ok, I would by default disable it and with force the plugin to run with I would also explain what needs to be done in the |
As dynamic imports are only supported in JEST with Node.js 21 and the experimental flag: NODE_OPTIONS=--experimental-vm-modules we by default disable the cds-plugin-ui5 to avoid issues. It can be forcefully activated by CDS_PLUGIN_UI5_ACTIVE=true when testing in the environment as described above. Fixes #901
As dynamic imports are only supported in JEST with Node.js 21 and the experimental flag: NODE_OPTIONS=--experimental-vm-modules we by default disable the cds-plugin-ui5 to avoid issues. It can be forcefully activated by CDS_PLUGIN_UI5_ACTIVE=true when testing in the environment as described above. Fixes #901
cds-plugin-ui5 |
When using
cds-plugin-ui5
any jest tests in my project fail with a segment fault ass below:If I remove the plugin, the test then work properly. Add the plugin again and they fail.
Sample repo: https://github.tools.sap/BTP-CEE/consumptionopps (branch main - Peter you have been added as a contributer).
The text was updated successfully, but these errors were encountered: