-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Every package whose major version larger than 6 is not work #195
Comments
I encountered this problem today too and went down a bit of a rabbit hole. It seems that the problem is more with Jest than it is with Yeoman-test. Yeoman-test relies on mem-fs which in turn relies on textextensions which uses the same package definitions yeoman-test so it will break there too. It has something to do with the resolve module that Jest uses. The way I solved it was to use Mocha for the generator tests and Jest for my other unit tests. I used .spec for mocha tests and .test for Jest ones and it works fine. Not a solution but a workaround. Hope that helps! |
I have been using latest beta with vitest (threads needs to be disabled) and mocha. |
This may well have to do with the transition to ECMAScript modules. Jest itself claims that support for ESM is still experimental, and it does take going through a few hoops to get existing Node.js code to run, especially if not all code is ready to be migrated to use ECMAScript modules exclusively. |
Thanks for the reply, actually I don't understand why mocha will work because I think if the author didn't point to the I think it's strange, do you have any other clue? :think: |
mocha doesn't even work for me. why was the
|
This package is ESM only package now. You should update your packages according to ESM migration. |
For jest 29, ESM packages should be added to transformIgnorePatterns. |
I think there's a severe lack of documentation that describes this breaking change and what developers should do to upgrade. Please add concrete examples to your documentation that address how to get started with mocha or jest, since both do not work with the latest yeoman-test without custom configuration. |
mocha works out-of-the-box using this example https://github.com/yeoman/yeoman-test/blob/main/README.md#usage. |
@ystxn please look what ESM/ECMAScript migration means, your generator is CJS https://github.com/finos/generator-symphony/blob/master/test/app.spec.js. |
"I recently installed the yeoman-test@7 package in my local environment and used Jest to test my project. However, I encountered the following Jest error: 'Cannot find module 'yeoman-test' from '.
Upon investigation, I discovered that the yeoman-test package no longer includes the main field in its package.json file starting from version 6.3.0. This causes Jest to be unable to locate the entry file, as it is now stored in the dist directory.
Could you please address this issue and provide a fix?
The text was updated successfully, but these errors were encountered: