Skip to content

--skip-plugins is not removed from args #6971

Closed
@MatthijsBurgh

Description

@MatthijsBurgh

Version

5.0.0-rc.2

Environment info

  System:
    OS: Linux 5.13 Ubuntu 20.04.3 LTS (Focal Fossa)
    CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
  Binaries:
    Node: 16.13.2
    Yarn: 1.22.17
    npm: 8.3.2
  Browsers:
    Chrome: 99.0.4840.0
    Firefox: 96.0
  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.1.1 
    @vue/babel-plugin-transform-vue-jsx:  1.2.1 
    @vue/babel-preset-app:  5.0.0-rc.2 (4.5.15)
    @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: ^5.0.0-rc.2 => 5.0.0-rc.2 
    @vue/cli-overlay:  5.0.0-rc.2 
    @vue/cli-plugin-babel: ^5.0.0-rc.2 => 5.0.0-rc.2 
    @vue/cli-plugin-eslint: ^5.0.0-rc.2 => 5.0.0-rc.2 
    @vue/cli-plugin-router:  5.0.0-rc.2 
    @vue/cli-plugin-typescript: ^5.0.0-rc.2 => 5.0.0-rc.2 
    @vue/cli-plugin-unit-jest: ^5.0.0-rc.2 => 5.0.0-rc.2 
    @vue/cli-plugin-unit-mocha: ^5.0.0-rc.2 => 5.0.0-rc.2 
    @vue/cli-plugin-vuex:  5.0.0-rc.2 
    @vue/cli-service: ^5.0.0-rc.2 => 5.0.0-rc.2 
    @vue/cli-shared-utils: ^5.0.0-rc.1 => 5.0.0-rc.2 
    @vue/cli-test-utils: ^5.0.0-rc.2 => 5.0.0-rc.2 
    @vue/cli-ui:  5.0.0-rc.2 
    @vue/cli-ui-addon-webpack:  5.0.0-rc.2 
    @vue/cli-ui-addon-widgets:  5.0.0-rc.2 
    @vue/compiler-core:  3.2.26 
    @vue/compiler-dom:  3.2.26 
    @vue/component-compiler-utils:  3.3.0 
    @vue/eslint-config-typescript: ^10.0.0 => 10.0.0 
    @vue/shared:  3.2.26 
    @vue/web-component-wrapper:  1.3.0 
    eslint-plugin-vue:  8.2.0 
    jest-serializer-vue:  2.0.2 
    typescript: ^4.5.4 => 4.5.4 (4.1.6)
    vue: ^2.5.20 => 2.6.14 
    vue-codemod:  0.0.5 
    vue-eslint-parser:  8.0.1 
    vue-hot-reload-api:  2.3.4 
    vue-loader:  17.0.0 (15.9.8)
    vue-router:  3.5.3 
    vue-server-renderer:  2.6.14 
    vue-style-loader:  4.1.3 
    vue-template-compiler: ^2.5.20 => 2.6.14 
    vue-template-es2015-compiler:  1.9.1 
    vuepress: ^1.5.1 => 1.9.5 
    vuepress-html-webpack-plugin:  undefined (3.2.0)
    vuepress-plugin-container:  2.1.5 
    vuepress-plugin-smooth-scroll:  0.0.3 
  npmGlobalPackages:
    @vue/cli: 5.0.0-rc.2 

Steps to reproduce

  1. Have a package with unit-jest and another cli plugin.
  2. Create a script which contains: vue-cli-service test:unit --skip-plugins ANY_INSTALLED_PLUGIN_OTHER_THAN_UNIT_JEST
  3. Run the script: npm/yarn run SCRIPT_NAME

What is expected?

--skip-plugins should in my opinion only be used in @vue/cli-service. As this argument is not relevant for any plugin, correct me if I am wrong.

So the argument and it's value should be removed from args and rawArgv

What is actually happening?

--skip-plugins are not removed from args and rawArgv. In the unit-jest plugin, the rawArgv are passed directly to jest. Which causes jest to raise an error

Unrecognized CLI Parameter:

  Unrecognized option "skip-plugins".

  CLI Options Documentation:
  https://jestjs.io/docs/cli

So I think that we should remove --skip-plugins from the arguments. Another solution could be that the unit-jest plugin is changed to filter the arguments there. But I think we should only go for the latter, if you think that there could be any plugin that would require/use the --skip-plugins argument.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions