Skip to content

Vitest does not discover tests in workspaces #6354

@ufr-scf

Description

@ufr-scf

Describe the bug

Vitest does not discover test suites in test files located in workspaces. This only happens when the workspace has it's own installation of vitest, i.e. is not referenced as an npm workspace in the root package.json.

Reproduction

https://github.com/ufr-scf/vitest-monorepo-bug

System Info

System:
    OS: Linux 5.15 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
    Memory: 4.01 GB / 7.61 GB
    Container: Yes
    Shell: 5.2.15 - /bin/bash
  Binaries:
    Node: 22.5.1 - /usr/local/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.8.2 - /usr/local/bin/npm
    pnpm: 9.6.0 - /usr/local/share/npm-global/bin/pnpm
  npmPackages:
    vitest: ^2.0.5 => 2.0.5

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions