vuejs / vue-jest

Jest Vue transformer
MIT License
746 stars 157 forks source link

Support jest 28 #467

Closed Theiaz closed 2 years ago

Theiaz commented 2 years ago

Jest 28 has been released two days ago. We upgraded our project following the official migration guide.

Currently, we are using the following versions:

  "devDependencies": {
    "@vue/vue3-jest": "27.0.0",
    "babel-jest": "27.5.1",
    "jest": "27.5.1",
  },
  "dependencies": {
    "@jest/globals": "27.5.1",
    "vue": "3.2.33",
  }

After upgrading to v28, many of our tests are failing with the following error message:

Test suite failed to run

    TypeError: babelJest.getCacheKey is not a function

      at Object.getCacheKey (node_modules/@vue/vue3-jest/lib/index.js:13:19)
      at ScriptTransformer._getCacheKey (node_modules/@jest/transform/build/ScriptTransformer.js:278:41)
      at ScriptTransformer._getFileCachePath (node_modules/@jest/transform/build/ScriptTransformer.js:349:27)
      at ScriptTransformer.transformSource (node_modules/@jest/transform/build/ScriptTransformer.js:590:32)
      at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:760:40)
      at ScriptTransformer.transform (node_modules/@jest/transform/build/ScriptTransformer.js:817:19)

I have not found any hints in this repo when vue-jest will support jest v28. Are there any plans or a roadmap?

Tofandel commented 2 years ago

It's funny, it's the same error message as when vue-jest 26 didn't support babel-jest 27 as well

lmiller1990 commented 2 years ago

Yes, we should support this. Are you interested in working on this? It looks like we just need to work through the differences.

Theiaz commented 2 years ago

@lmiller1990 and @valentinpalkovic Thanks for your work!