Skip to content

[BUG] Dashed args are not used for debug tests #1241

@CSchulz

Description

@CSchulz

Describe the bug
If you are enabling dashed args option it should translate every jest parameter to dashed args.
This works fine in normal run mode (run test), but doesn't work for debug mode (debug test).

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Settings' and enable "Use dashed args"
  2. Toggle Developer Tools
  3. Run test
  4. Debug test (breaks)

Expected behavior
Command call from the developer console for "run test":

command=./node_modules/@angular/cli/bin/ng.js run timed-text-editor:test --test-location-in-results --json --use-stderr --output-file /tmp/jest_runner_tte_frontend_dev_1000_2.json --test-name-pattern ProjectComponent --no-coverage --reporters default --reporters "/home/vscode/.vscode-server/extensions/orta.vscode-jest-6.4.3/out/reporter.js" --colors --watch-all=false --test-path-pattern ".../project\.component\.spec\.ts"

Command call from the terminal for "debug test":
/usr/bin/env 'NODE_OPTIONS= --require /vscode/vscode-server/bin/linux-arm64/19e0f9e681ecb8e5c09d8784acaa601316ca4571/extensions/ms-vscode.js-debug/src/bootloader.js --inspect-publish-uid=http' 'VSCODE_INSPECTOR_OPTIONS=:::{"inspectorIpc":"/tmp/node-cdp.483-adbdb519-7.sock","deferredMode":false,"waitForDebugger":"","execPath":"/usr/local/share/nvm/current/bin/node","onlyEntrypoint":false,"autoAttachMode":"always","mandatePortTracking":true,"fileCallback":"/tmp/node-debug-callback-8eadc97ebf6e62ab"}' /usr/local/share/nvm/current/bin/node --experimental-network-inspection ./node_modules/@angular/cli/bin/ng.js run timed-text-editor:test --runInBand --watchAll=false --testNamePattern ProjectComponent --runTestsByPath project.component.spec.ts

Environment (please complete the following information):

  • vscode-jest version: 6.4.3
  • node -v: 22.15.0
  • npm -v or yarn --version: 10.9.2
  • jest or react-scripts (if you haven’t ejected) version: 29.7.0
  • your vscode-jest settings:
    "jest.jestCommandLine": "./node_modules/@angular/cli/bin/ng.js run timed-text-editor:test",
    "jest.debugMode": true,
    "jest.useDashedArgs": true
  • Operating system: Linux

Prerequisite

  • are you able to run jest from the command line? yes
  • where do you run jest CLI from? via Angular CLI
  • how do you run your tests from the command line? ./node_modules/@angular/cli/bin/ng.js run editor:test

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