Skip to content

Vitest CLI 1.3.0 no longer accepts multiple projects via --project option #5262

@ldiqual

Description

@ldiqual

Describe the bug

yarn vitest --project <project1> <project2> no longer works as of 1.3.0.

Error: Expected a single value for option "--project <name>", received ["project1", "project2"]
    at transform (file:///home/circleci/project/node_modules/vitest/dist/vendor/cac.wWT9ELdg.js:19369:13)
    at setDotProp (file:///home/circleci/project/node_modules/vitest/dist/vendor/cac.wWT9ELdg.js:316:22)
    at CAC.mri (file:///home/circleci/project/node_modules/vitest/dist/vendor/cac.wWT9ELdg.js:700:9)
    at CAC.parse (file:///home/circleci/project/node_modules/vitest/dist/vendor/cac.wWT9ELdg.js:617:27)
    at file:///home/circleci/project/node_modules/vitest/dist/cli.js:67:13
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25)

I could not find a relevant changelog line for this.

Reproduction

yarn vitest --project <project1> <project2> where project1 and project2 are 2 projects in the vitest workspace

System Info

System:
    OS: macOS 14.2.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 128.27 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.17.1 - ~/Library/Caches/fnm_multishells/60559_1708468325626/bin/node
    Yarn: 3.8.0 - ~/Library/Caches/fnm_multishells/60559_1708468325626/bin/yarn
    npm: 9.6.7 - ~/Library/Caches/fnm_multishells/60559_1708468325626/bin/npm
  Browsers:
    Chrome: 121.0.6167.184
    Firefox: 109.0.1
    Safari: 17.2.1
  npmPackages:
    @vitejs/plugin-react-swc: 3.6.0 => 3.6.0
    vite: 5.1.3 => 5.1.3
    vitest: 1.2.2 => 1.2.2

Used Package Manager

yarn

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    p3-minor-bugAn edge case that only affects very specific usage (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions