vue-jest: Jest coverage reports cause an error with v4.0.0-beta.2

I just decided to give the latest beta a spin, and it worked well for running the unit tests, but when also trying to add a coverage report, I got:

resources/components/NotificationBox/NotificationBox.spec.js
  ● Test suite failed to run

    /home/daniel/Repos/omm/resources/components/NotificationBox/NotificationBox.vue: don't know how to turn this value into a node

      at valueToNode (node_modules/@babel/core/node_modules/@babel/types/lib/converters/valueToNode.js:87:9)
      at Object.valueToNode (node_modules/@babel/core/node_modules/@babel/types/lib/converters/valueToNode.js:81:58)
      at Object.exit (node_modules/istanbul-lib-instrument/dist/visitor.js:638:30)
      at PluginPass.exit (node_modules/babel-plugin-istanbul/lib/index.js:158:38)
      at newFn (node_modules/@babel/core/node_modules/@babel/traverse/lib/visitors.js:179:21)
      at NodePath._call (node_modules/@babel/core/node_modules/@babel/traverse/lib/path/context.js:55:20)
      at NodePath.call (node_modules/@babel/core/node_modules/@babel/traverse/lib/path/context.js:42:17)
      at NodePath.visit (node_modules/@babel/core/node_modules/@babel/traverse/lib/path/context.js:99:8)
      at TraversalContext.visitQueue (node_modules/@babel/core/node_modules/@babel/traverse/lib/context.js:112:16)
      at TraversalContext.visitSingle (node_modules/@babel/core/node_modules/@babel/traverse/lib/context.js:84:19)
      at TraversalContext.visit (node_modules/@babel/core/node_modules/@babel/traverse/lib/context.js:140:19)
      at Function.traverse.node (node_modules/@babel/core/node_modules/@babel/traverse/lib/index.js:84:17)
      at traverse (node_modules/@babel/core/node_modules/@babel/traverse/lib/index.js:66:12)
      at transformFile (node_modules/@babel/core/lib/transformation/index.js:107:29)
          at transformFile.next (<anonymous>)
      at run (node_modules/@babel/core/lib/transformation/index.js:35:12)

Downgrading to v3.0.5 fixed the issue and printed out coverage reports again.

I am using:

"babel-jest": "^25.5.1",
"jest": "^25.5.3",
"nuxt": "^2.12.2",

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 18
  • Comments: 21 (4 by maintainers)

Commits related to this issue

Most upvoted comments

I’m using

babel-jest@25.4.0
jest@25.4.0
nuxt@2.12.2
vue-jest@4.0.0-beta.2

Trying to upgrade to babel-jest@26.0.1 and jest@26.0.1 results in

don't know how to turn this value into a node

I just tested and it works! I’m glad I could help with it

Hi @lmiller1990 Thanks for your work on this. I am on 4.0.0-beta.6 now, but I am still getting the same error message when trying to generate coverage reports. Does it work for you with the latest release? A sidenote: I installed it from github since I don’t think the latest beta versions are on npm yet?

Moreover, my tests now appear to fail for all .vue files when running with coverage, while these pass whenever I run jest with the --no-coverage flag.