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

@vue/cli-plugin-unit-jest/presets/typescript-and-babel not found #6383

Closed
spacedawwwg opened this issue Mar 25, 2021 · 7 comments · Fixed by #6418
Closed

@vue/cli-plugin-unit-jest/presets/typescript-and-babel not found #6383

spacedawwwg opened this issue Mar 25, 2021 · 7 comments · Fixed by #6418
Labels
needs reproduction This issue is missing a minimal runnable reproduction, provided by the author

Comments

@spacedawwwg
Copy link

Version

5.0.0-alpha.8

Environment info

Environment Info:

  System:
    OS: macOS 11.2.3
    CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
  Binaries:
    Node: 14.15.5 - ~/.nvm/versions/node/v14.15.5/bin/node
    Yarn: 1.22.5 - ~/.yarn/bin/yarn
    npm: 6.14.11 - ~/.nvm/versions/node/v14.15.5/bin/npm
  Browsers:
    Chrome: 89.0.4389.90
    Edge: 89.0.774.57
    Firefox: 85.0.2
    Safari: 14.0.3
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.2.1 
    @vue/babel-helper-vue-transform-on:  1.0.2 
    @vue/babel-plugin-jsx:  1.0.3 
    @vue/babel-plugin-transform-vue-jsx:  1.2.1 
    @vue/babel-preset-app:  5.0.0-alpha.8 
    @vue/babel-preset-jsx:  1.2.4 
    @vue/babel-sugar-composition-api-inject-h:  1.2.1 
    @vue/babel-sugar-composition-api-render-instance:  1.2.4 
    @vue/babel-sugar-functional-vue:  1.2.2 
    @vue/babel-sugar-inject-h:  1.2.2 
    @vue/babel-sugar-v-model:  1.2.3 
    @vue/babel-sugar-v-on:  1.2.3 
    @vue/cli-overlay:  5.0.0-alpha.8 
    @vue/cli-plugin-babel: 5.0.0-alpha.8 => 5.0.0-alpha.8 
    @vue/cli-plugin-eslint: 5.0.0-alpha.8 => 5.0.0-alpha.8 
    @vue/cli-plugin-router: 5.0.0-alpha.8 => 5.0.0-alpha.8 
    @vue/cli-plugin-typescript: 5.0.0-alpha.8 => 5.0.0-alpha.8 
    @vue/cli-plugin-unit-jest: ^5.0.0-alpha.8 => 5.0.0-alpha.8 
    @vue/cli-plugin-vuex:  5.0.0-alpha.8 
    @vue/cli-service: 5.0.0-alpha.8 => 5.0.0-alpha.8 
    @vue/cli-shared-utils:  5.0.0-alpha.8 
    @vue/component-compiler-utils:  3.2.0 
    @vue/eslint-config-typescript: ^7.0.0 => 7.0.0 
    @vue/test-utils: ^1.1.3 => 1.1.3 
    @vue/web-component-wrapper:  1.3.0 
    eslint-plugin-vue: ^7.8.0 => 7.8.0 
    jest-serializer-vue:  2.0.2 
    typescript: ~4.2.3 => 4.2.3 
    vue: ^2.6.12 => 2.6.12 
    vue-eslint-parser:  7.6.0 
    vue-hot-reload-api:  2.3.4 
    vue-loader:  16.1.2 (15.9.6)
    vue-router: ^3.5.1 => 3.5.1 
    vue-style-loader:  4.1.3 
    vue-template-compiler: ^2.6.12 => 2.6.12 
    vue-template-es2015-compiler:  1.9.1 
  npmGlobalPackages:
    @vue/cli: 5.0.0-alpha.8

Steps to reproduce

run vue-cli-service test:unit

What is expected?

tests run

What is actually happening?

@vue/cli-plugin-unit-jest/presets/typescript-and-babel not found

@haoqunjiang
Copy link
Member

Thanks for submitting this issue! Due to our limited time, we ask you to include a reproduction link to a minimal full reproduction of your problem (for example in a GitHub repository) so we can find what is causing the issue. Thank you for your understanding!

@haoqunjiang haoqunjiang added the needs reproduction This issue is missing a minimal runnable reproduction, provided by the author label Mar 26, 2021
@jiangjunfeng98
Copy link

devDependencies:

    "@types/jest": "^26.0.20",
    "@typescript-eslint/eslint-plugin": "^4.15.1",
    "@typescript-eslint/parser": "^4.15.1",
    "@vue/cli-plugin-babel": "~5.0.0-alpha.8",
    "@vue/cli-plugin-eslint": "~5.0.0-alpha.8",
    "@vue/cli-plugin-router": "~5.0.0-alpha.8",
    "@vue/cli-plugin-typescript": "~5.0.0-alpha.8",
    "@vue/cli-plugin-unit-jest": "~5.0.0-alpha.8",
    "@vue/cli-plugin-vuex": "~5.0.0-alpha.8",
    "@vue/cli-service": "~5.0.0-alpha.8",
    "@vue/compiler-sfc": "^3.0.4",
    "@vue/eslint-config-airbnb": "^5.3.0",
    "@vue/eslint-config-typescript": "^7.0.0",
    "@vue/test-utils": "^2.0.0-0",
    "eslint": "^7.20.0",
    "eslint-plugin-import": "^2.20.2",
    "eslint-plugin-vue": "^7.2.0",
    "lint-staged": "^10.5.4",
    "sass": "^1.32.7",
    "sass-loader": "^11.0.1",
    "ts-jest": "^26.5.3",
    "typescript": "~4.1.5",
    "vue-jest": "^5.0.0-0"

it's ok!

@spacedawwwg
Copy link
Author

@jiangjunfeng98 are you saying I'm missing a new dependency from 5.0.0-alpha.7 to 5.0.0-alpha.8?

As an update, I just reverted @vue/cli-plugin-unit-jest back to 5.0.0-alpha.7 (left the rest at 5.0.0-alpha.8) and all was ok.

@jiangjunfeng98
Copy link

你可以对比一下差异,我记得需要删除某个依赖。最简单的方法是使用 cli 生成一个demo。

Baidu Translate:

You can compare the differences. I remember that I need to delete a dependency. The simplest way is to generate a demo using cli

@haoqunjiang
Copy link
Member

vue-jest and ts-jest are now required as direct dependencies of the project. I suppose the warnings would show up when you install the project dependencies.

@m0ksem
Copy link
Contributor

m0ksem commented Apr 13, 2021

@sodatea, Since ts-jest is optional dependency there is not warning during installation. It would be nice to add some message like "You should install ts-jest dependency" as fallback. Currently jest shows Preset @vue/cli-plugin-unit-jest/presets/typescript-and-babel not found. because there is error produced by require.resolve('ts-jest').

haoqunjiang pushed a commit that referenced this issue Apr 15, 2021
…ot installed (#6418)

Co-authored-by: Haoqun Jiang <haoqunjiang@gmail.com>

closes #6383
@elinholde
Copy link

I solved this problem with update jest plugin from: @vue/cli-plugin-unit-jest": "^3.12.1" to: @vue/cli-plugin-unit-jest": "^4.5.0"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs reproduction This issue is missing a minimal runnable reproduction, provided by the author
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants