Skip to content

[BUG] testPathPattern overescaping when run via pwsh #1284

Description

@opswole

Describe the bug
I'm trying to configure the extension in our vscode workspace but it won't match any tests when triggered via a gutter icon, it seems to be the logic that creates the --testPathPattern overescaping the dir:

Expected behavior
The tests run

Screenshots
Image

Environment (please complete the following information):

  • vscode-jest version: 6.4.4
  • node -v: 22.22
  • npm -v or yarn --version: npm 10.9.4 | pnpm 9.5.0
  • jest or react-scripts (if you haven’t ejected) version: 29.7.0
  • your vscode-jest settings:
    • "jest.jestCommandLine": "pnpm exec jest --",
    • "jest.runMode": "on-demand",
  • Operating system: Windows 11 | PowerShell 7.5.5

Prerequisite

  • are you able to run jest from the command line? yeah
  • where do you run jest CLI from? Root of the Microservice directory or from Repo root with pnpm filter
  • how do you run your tests from the command line? (e.g., "npm run test" or "node_modules/.bin/jest") pnpm exec jest or pnpm test which calls jest --testTimeout=[number]

Additional context
Add any other context about the problem here.

I couldn't find another bug that was along these lines, but I do believe its an overescaping issue as I can run in my terminal and the test matches

Image

The fastest (and the most fun) way to resolve the issue is to submit a pull request yourself. If you are interested, please check out the contribution guide, we look forward to seeing your PR...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions