Skip to content

[Bug]: --selectProjects ignores file path arguments on Windows #15878

@kbigdelysh

Description

@kbigdelysh

Version

29.7.0

Steps to reproduce

  1. Clone the reproduction repository at https://github.com/kbigdelysh/jest-windows-path-bug-reproduction
  2. Install dependencies: pnpm install (or npm install)
  3. Run the command: pnpm run test:specific (or npx jest --selectProjects unit src/__tests__/example-one.test.ts)
  4. Expected: Should run 1 test suite (3 tests) from example-one.test.ts
  5. Actual: Runs all 3 test suites (9 tests) - the file path argument is completely ignored

Additional verification:

  • Running pnpm run test:workaround (uses --testPathPattern=example-one) correctly runs only 1 test suite
  • This confirms --selectProjects specifically ignores file path arguments on Windows

Environment: Windows 10/11, Jest 29.7.0, Node.js v22.11.0, PowerShell

Expected behavior

Expected: Should run 1 test suite (3 tests) from example-one.test.ts

Actual behavior

Actual: Runs all 3 test suites (9 tests) - the file path argument is completely ignored

Additional context

No response

Environment

System:
  OS: Windows 11 10.0.26100
  CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
Binaries:
  Node: 22.11.0 - C:\Program Files\nodejs\node.EXE
  npm: 10.9.0 - C:\Program Files\nodejs\npm.CMD
  pnpm: 9.13.0 - C:\Users\shaml\AppData\Roaming\npm\pnpm.CMD
npmPackages:
  jest: ^29.7.0 => 29.7.0

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