-
Notifications
You must be signed in to change notification settings - Fork 669
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
Refine package exports to fix Jest 28 out of box compatibility #1975
Comments
Yeah - this lib is quite old and pre-dates ESM as a thing. We should probably support it, now that it's more widely used. Care to make a PR? |
An explanation about this problem, dunno if it's fixable on vue-test-utils side, using |
A possible solution could be to export a Jest config preset and use it to set everything correctly, but I guess that's more a problem for |
Just hit this one while migrating my app to @IlCallo I understand it's not a
|
PRs to make docs better are always a good idea 🙏 Note this code base is for VTU v1 (Vue 2). You might want https://github.com/vuejs/test-utils for the Vue 3 version. |
Context: vuejs/vue-test-utils#1975 (comment) As discussed, there a couple of issues that the community faced while upgrading to vue@3 @vue/test-utils@^2 but that are not directly related with them. In a effort to make migrations more smooth, a new section was added to the migration docs that lists some common problems with underlying test runners, that might happen simply because of the fact that users took the opportunity to upgrade their test stacks dependecies as well. It starts with a few issues with jest, one reported in the legacy test-utils repo and other one that i've personally faced. vuejs/vue-test-utils#1975
@lmiller1990 done vuejs/test-utils#1923, feel free to edit and make the writing/formatting style more aligned with the rest of the docs. Cheers! ✌️ |
Context: vuejs/vue-test-utils#1975 (comment) As discussed, there a couple of issues that the community faced while upgrading to vue@3 @vue/test-utils@^2 but that are not directly related with them. In a effort to make migrations more smooth, a new section was added to the migration docs that lists some common problems with underlying test runners, that might happen simply because of the fact that users took the opportunity to upgrade their test stacks dependecies as well. It starts with a few issues with jest, one reported in the legacy test-utils repo and other one that i've personally faced. vuejs/vue-test-utils#1975
Closed in #1923 |
@lmiller1990 I'm not sure why you said 'closed' to an open issue |
My mistake, is this still a bug? I think it was fixed, I might have tagged the wrong issue. |
#1923 has a reproduction link but hasn't been reviewed by anyone. This one seems closed. What I didn't fully understand is the relation. Maybe you wanted to link a PR. I guess it's fine for now. |
Currently,
@vue/test-utils
doesn't work with Jest v28 + JSDOM out of the box, requiring the following workaround to prevent trying to read the browser export where CJS is expected:jest.config.js
Cleanup
What should be cleaned up or changed:
Refine the package.json exports declarations for the browser to offer the ESM and CJS editions in case of import and require being used. To do so would allow the package to work out of the box with Jest v28 + jest-environment-jsdom
Provide any links for context:
The text was updated successfully, but these errors were encountered: