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

update jest to ^25 #5114

Closed
ItsANameToo opened this issue Jan 28, 2020 · 10 comments
Closed

update jest to ^25 #5114

ItsANameToo opened this issue Jan 28, 2020 · 10 comments

Comments

@ItsANameToo
Copy link

What problem does this feature solve?

Jest 25 was released a few days ago: https://jestjs.io/blog/2020/01/21/jest-25 . It would be appreciated if the vue-cli-plugin-jest would be updated to use that version instead of ^24.9.0

What does the proposed API look like?

Update the jest dependency to its latest version

@LinusBorg
Copy link
Member

That will happen in the next major as it's a breaking change

@DRoet
Copy link
Contributor

DRoet commented Jan 29, 2020

didn't @vue/cli 4.0 already make a non breaking transition possible by pulling in jsdom v15?

@LinusBorg
Copy link
Member

If that's really the only breaking change, then yes. The release announcement wasn't too clear about this.

@sodatea
Copy link
Member

sodatea commented Mar 5, 2020

I thought so, but it turns out not the case. The jsdom-v15 thing only makes the transition easier but there are still breaking changes.

  1. Packages like ts-jest rely on hard-coded Jest version and it's not under our control.
  2. Seems Jest 25 breaks vue-jest test coverage Vue SFCs not included in coverage reports vue-jest#217

@JordyLangen
Copy link

In our current project we are running:

"@vue/cli-plugin-unit-jest": "4.3.1",
"jest": "25.5.2",
"ts-jest": "25.3.1",
"vue-jest": "3.0.5",

Fixing the jest version like this:

"resolutions": {
    "jest": "25.5.2"
  },

Which does seem to work for us, which would also imply that jest 25.* is not a breaking change?
Both test execution and code coverage is working.

@LinusBorg
Copy link
Member

Which does seem to work for us, which would also imply that jest 25.* is not a breaking change?

It's merely implies that your codebase doesn't use any part of jest that has a breaking change, and thus isn't affected.

@sodatea
Copy link
Member

sodatea commented May 7, 2020

Think about this use case:

package.json:

{
  "@vue/cli-plugin-unit-jest": "^4.1.0",
  "ts-jest": "^24.0.0"
}

ts-jest has hard-coded the allowed jest version range. So if we silently updated the underlying jest version to v25, it will throw. That will break the user's project.

@just-boris
Copy link

The Jest 26 is out: https://jestjs.io/blog/2020/05/05/jest-26

Among other important changes, it has an upgraded JSOM.

In my Vue app I use web-components, which do not work in JSDOM versions < 16. As an intermediate solution I am using jest-environment-jsdom-sixteen, but it would be great to have this integration built-in

@ihorbond
Copy link

ihorbond commented Nov 2, 2020

Agreed please upgrade to Jest 26 so we can test web components

@gregveres
Copy link

gregveres commented Nov 16, 2020

I upgraded jest to v26 with this in my package.json file. (using Yarn)

  "resolutions": {
    "jest": "^26.6.3",
    "ts-jest": "^26.4.4",
    "babel-jest": "^26.6.3"
  }

Now I can use jset v26 while waiting for @vue/cli-plugin-unit-jest to be upgraded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants