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
- fix(jest): downgrate vue-jest to v3 pending by https://github.com/vuejs/vue-jest/issues/241 — committed to nuxt/create-nuxt-app by clarkdo 4 years ago
- Downgrades vue-jest to 3.0.4 Fixes "don't know how to turn this value into a node" See issue vuejs/vue-jest#241 — committed to ianpurvis/purvisresearch.com by ianpurvis 4 years ago
- fix(jest): downgrate vue-jest to v3 pending by https://github.com/vuejs/vue-jest/issues/241 — committed to nuxt/create-nuxt-app by clarkdo 4 years ago
- feat: prepare for Nuxt 2.13 (#529) * feat: prepare for Nuxt 2.13 * fix(jest): downgrate vue-jest to v3 pending by https://github.com/vuejs/vue-jest/issues/241 * chore(deps): update all non-maj... — committed to nuxt/create-nuxt-app by Atinux 4 years ago
- fix: convert SourceMapGenerator to RawSourceMap - fixes vuejs/vue-jest#241 and facebook/jest#10089 — committed to nogic1008/vue-jest by nogic1008 4 years ago
- fix(jest): downgrate vue-jest to v3 pending by https://github.com/vuejs/vue-jest/issues/241 — committed to omarjmal31/create-nuxt-app by omarjmal31 4 years ago
- feat: prepare for Nuxt 2.13 (#529) * feat: prepare for Nuxt 2.13 * fix(jest): downgrate vue-jest to v3 pending by https://github.com/vuejs/vue-jest/issues/241 * chore(deps): update all non-maj... — committed to omarjmal31/create-nuxt-app by Atinux 4 years ago
I’m using
Trying to upgrade to
babel-jest@26.0.1andjest@26.0.1results inI 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-coverageflag.