question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

adding @vue/cli-plugin-unit-jest breaks

See original GitHub issue

Version

3.7.0

Environment info

System:
    OS: macOS 10.14.4
    CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
  Binaries:
    Node: 11.15.0 - /usr/local/bin/node
    Yarn: Not Found
    npm: 6.9.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 74.0.3729.169
    Firefox: Not Found
    Safari: 12.1
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0-beta.3 
    @vue/babel-plugin-transform-vue-jsx:  1.0.0-beta.3 
    @vue/babel-preset-app:  3.7.0 
    @vue/babel-preset-jsx:  1.0.0-beta.3 
    @vue/babel-sugar-functional-vue:  1.0.0-beta.3 
    @vue/babel-sugar-inject-h:  1.0.0-beta.3 
    @vue/babel-sugar-v-model:  1.0.0-beta.3 
    @vue/babel-sugar-v-on:  1.0.0-beta.3 
    @vue/cli-overlay:  3.7.0 
    @vue/cli-plugin-babel: ^3.7.0 => 3.7.0 
    @vue/cli-plugin-eslint: ^3.7.0 => 3.7.0 
    @vue/cli-plugin-typescript: ^3.7.0 => 3.7.0 
    @vue/cli-plugin-unit-jest: ^3.8.0 => 3.8.0 
    @vue/cli-service: ^3.7.0 => 3.7.0 
    @vue/cli-shared-utils:  3.7.0 (3.8.0)
    @vue/component-compiler-utils:  2.6.0 
    @vue/eslint-config-prettier: ^4.0.1 => 4.0.1 
    @vue/eslint-config-typescript: ^4.0.0 => 4.0.0 
    @vue/preload-webpack-plugin:  1.1.0 
    @vue/test-utils: ^1.0.0-beta.29 => 1.0.0-beta.29 
    @vue/web-component-wrapper:  1.2.0 
    eslint-config-vuetify: ^0.2.0 => 0.2.0 
    eslint-plugin-vue: ^5.0.0 => 5.2.2 (4.7.1)
    jest-serializer-vue:  2.0.2 
    typescript: ^3.4.3 => 3.4.5 
    vue: ^2.6.10 => 2.6.10 
    vue-class-component: ^7.1.0 => 7.1.0 
    vue-eslint-parser:  2.0.3 (5.0.0)
    vue-hot-reload-api:  2.3.3 
    vue-jest:  3.0.4 
    vue-loader:  15.7.0 
    vue-property-decorator: ^8.1.1 => 8.1.1 
    vue-rollbar: ^1.0.0 => 1.0.0 
    vue-router: ^3.0.3 => 3.0.6 
    vue-style-loader:  4.1.2 
    vue-template-compiler: ^2.5.21 => 2.6.10 
    vue-template-es2015-compiler:  1.9.1 
    vuedraggable: ^2.20.0 => 2.20.0 
    vuetify: ^1.5.14 => 1.5.14 
    vuex: ^3.1.1 => 3.1.1 
  npmGlobalPackages:
    @vue/cli: 3.7.0

Steps to reproduce

try adding @vue/cli-plugin-unit-jest: vue add @vue/cli-plugin-unit-jest

What is expected?

plugin installed and working

What is actually happening?

Plugin breaks with error message and jest doesnt work, transforming not possible.

No prompts found for @vue/cli-plugin-unit-jest WARN conflicting versions for project dependency “@vue/test-utils”:

Using newer version (1.0.0-beta.29), but this may cause build errors. ERROR SyntaxError: Unexpected token / in JSON at position 75 SyntaxError: Unexpected token / in JSON at position 75 at JSON.parse (<anonymous>) at api.render.files (/Users/slusnys/Workspace/equinnolab/portal/link/node_modules/@vue/cli-plugin-unit-jest/generator/index.js:118:29) at Generator.resolveFiles (/usr/local/lib/node_modules/@vue/cli/lib/Generator.js:209:13) at processTicksAndRejections (internal/process/task_queues.js:86:5) { Error: Command failed: vue invoke @vue/cli-plugin-unit-jest --$inlineOptions {}

🚀 Invoking generator for @vue/cli-plugin-unit-jest

at makeError (/usr/local/lib/node_modules/@vue/cli/node_modules/execa/index.js:174:9)
at Promise.all.then.arr (/usr/local/lib/node_modules/@vue/cli/node_modules/execa/index.js:278:16)
at processTicksAndRejections (internal/process/task_queues.js:86:5)

code: 1, stdout: ‘\n🚀 Invoking generator for @vue/cli-plugin-unit-jest…\n’, stderr: null, failed: true, signal: null, cmd: ‘vue invoke @vue/cli-plugin-unit-jest --$inlineOptions {}’, timedOut: false, killed: false }

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
reechcommented, May 14, 2020

@suedar I had the same problem when vue add @vue/cli-plugin-unit-jest, and it seems as @sodatea mentioned that I had a broken tsconfig.json. In my case due to a trailing/extra comma. As soon as I removed that it worked:

  "include": [
    "src/**/*.ts",
    "src/**/*.vue",
    "tests/**/*.ts", //<-- remove this
  ]
0reactions
qiuyaofancommented, Jun 11, 2021

tsconfig.json格式有问题就会,多了个逗号 http://www.kjson.com/jsoneditor/ 看json格式有没有问题可以在在线网站格式化测试下

Read more comments on GitHub >

github_iconTop Results From Across the Web

@vue/cli-plugin-unit-jest | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
vue/cli-plugin-unit-jest
unit -jest plugin for vue-cli ... Run unit tests with Jest. ... we need to add an exception to the transformIgnorePatterns option of...
Read more >
Vue CLI plugin to add Jest test runner doesn't transpile .js files
I made the project with the Vue CLI, using vue create demo-project choosing ESlint and Babel, then running vue add @vue/cli-plugin-unit-jest ...
Read more >
vue/cli-plugin-unit-jest - Awesome JS
There are still a few planned breaking changes that we are still working on. But most features are stable. So we think now...
Read more >
Vue CLI tutorial - Wallaby.js
module.exports = { preset: '@vue/cli-plugin-unit-jest', collectCoverage: true, // Add this line collectCoverageFrom: ['src/**/*.{js,vue}'], // Add this line } ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found