Skip to content
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

Support jest 27 #344

Closed
WIStudent opened this issue May 27, 2021 · 11 comments
Closed

Support jest 27 #344

WIStudent opened this issue May 27, 2021 · 11 comments
Labels
jest 27 upstream Due to other packages (like Jest)
Milestone

Comments

@WIStudent
Copy link

Using vue-jest@4.0.1 I am getting the following error when trying to upgrade to jest 27:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: jest@27.0.1
npm ERR! node_modules/jest
npm ERR!   dev jest@"27.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer jest@">=26 <27" from ts-jest@26.5.1
npm ERR! node_modules/ts-jest
npm ERR!   peerOptional ts-jest@">= 24 < 27 " from vue-jest@4.0.1
npm ERR!   node_modules/vue-jest
npm ERR!     dev vue-jest@"^4.0.1" from the root project

Node version: v16.2.0
npm version: 7.13.0

@WIStudent
Copy link
Author

Just saw that there is already a pull request for this issue: #343

@Tofandel
Copy link

Tofandel commented May 30, 2021

Be aware that vue-jest doesn't work with babel-jest version 27, but does work fine with jest version 27

TypeError: babelJest.getCacheKey is not a function

So you can still force the use of jest v27 just don't try to use babel-jest v27

@lmiller1990
Copy link
Member

lmiller1990 commented Jun 14, 2021

We are discussing this here: #343

If you are interested in helping out, that'd be great, let me know. We are exploring moving to a monorepo setup so we can be more flexible with what versions of things we support.

@nogic1008 nogic1008 added this to the 27.x milestone Jun 16, 2021
@nogic1008 nogic1008 pinned this issue Jun 16, 2021
@nogic1008 nogic1008 added the upstream Due to other packages (like Jest) label Jul 8, 2021
@jousi592
Copy link

Be aware that vue-jest doesn't work with babel-jest version 27, but does work fine with jest version 27

TypeError: babelJest.getCacheKey is not a function

So you can still force the use of jest v27 just don't try to use babel-jest v27

So how do I transpile "^.+\\.[t|j]sx?$" files in Jest test files?
If I omit the "^.+\\.[t|j]sx?$": "babel-jest" line from my Jest config, I get:

SyntaxError: Cannot use import statement outside a module

Any solution for that?

@lmiller1990
Copy link
Member

Are you using Jest 27? Vue 2? Vue 3?

We have tentative Vue 3 + Jest 27 support, see this comment. Follow the whole thread for some context - we are changing the versioning to mach Jest's versioning.

Vue 2 + Jest 27 support is not released yet.

@jousi592
Copy link

Vue 3 + Jest 27 with Quasar

@lmiller1990
Copy link
Member

Jest 27 support is coming soon - there is a early alpha, see this comment: #343 (comment)

I have no idea about Quasar, though.

@nogic1008
Copy link
Collaborator

v27.0.0-alpha.1 has been released.

  • If you are using vue-jest@4.x, replace to @vue/vue2-jest.
  • If you are using vue-jest@5.x or vue3-jest, replace to @vue/vue3-jest.

@nogic1008 nogic1008 unpinned this issue Sep 10, 2021
@amirensit
Copy link

v27.0.0-alpha.1 has been released.

  • If you are using vue-jest@4.x, replace to @vue/vue2-jest.
  • If you are using vue-jest@5.x or vue3-jest, replace to @vue/vue3-jest.

This worked for me. @nogic1008 the readme is not up to date.

...
'.*\\.(vue)$': '@vue/vue2-jest',

@lmiller1990
Copy link
Member

Would someone like to make a PR to update the README? That would be very useful.

@afontcu
Copy link
Member

afontcu commented Sep 21, 2021

Would someone like to make a PR to update the README? That would be very useful.

There it is (WIP): #388

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jest 27 upstream Due to other packages (like Jest)
Projects
None yet
Development

No branches or pull requests

7 participants