Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] vscode-jest-tests.v2 Debug Configuration does not replace variables when restarting session #1148

Open
tim-helloquickly opened this issue May 3, 2024 · 3 comments
Labels
external-dependency has dependency on external issues/fixes

Comments

@tim-helloquickly
Copy link

tim-helloquickly commented May 3, 2024

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Debug a test with the default v2 configuration
  2. Set a breakpoint and let it stop
  3. Click the "restart" button on the menu bar
  4. See error, command runs but with the litt

Expected behavior
Expect the same test to run the same way as the first time:
jest --runInBand --watchAll=false --testNamePattern 'redacted$' --runTestsByPath /Users/redacted.test.tsx --testTimeout=100000000 --coverage=false

But the second time around,

jest --runInBand --watchAll=false --testNamePattern '${jest.testNamePattern}' --runTestsByPath '${jest.testFile}' --testTimeout=100000000 --coverage=false

Screenshots
Here is an output

Environment (please complete the following information):

  • vscode-jest version: v6.2.5
  • node -v: v18.18.0
  • npm -v or yarn --version: yarn 1.22.19
  • jest or react-scripts (if you haven’t ejected) version: jest 29.3.1
  • Operating system: MacOS 14.2.1

Prerequisite

  • are you able to run jest from the command line? Yes
  • where do you run jest CLI from? Root
  • how do you run your tests from the command line? jest

Additional context
Add any other context about the problem here.

@connectdotz
Copy link
Collaborator

@tim-helloquickly, thanks for bringing this to our attention, I can confirm this is a reproducible bug. I am working with the vscode team to see how we can best resolve it (microsoft/vscode#212005).

@connectdotz connectdotz added the external-dependency has dependency on external issues/fixes label May 4, 2024
@connectdotz
Copy link
Collaborator

@tim-helloquickly, I can't seem to be able to reproduce this issue today. Thinking maybe vscode has fixed it already. Can you confirm in your env?

@tim-helloquickly
Copy link
Author

tim-helloquickly commented May 31, 2024

I gave it a shot, I can still reproduce -- here is my configuration:

    {
      "type": "node",
      "name": "vscode-jest-tests.v2",
      "request": "launch",
      "args": [
        "test",
        "--watchAll=false",
        "--forceExit",
        "--testNamePattern",
        "${jest.testNamePattern}",
        "--testTimeout=100000000",
        "--runTestsByPath",
        "${jest.testFile}"
      ],
      "cwd": "${workspaceFolder}",
      "console": "integratedTerminal",
      "internalConsoleOptions": "neverOpen",
      "runtimeExecutable": "yarn",
      "skipFiles": [
        "<node_internals>/**",
        "${workspaceFolder}/<node_internals>/**",
        "${workspaceFolder}/node_modules/**"
      ]
    },

One thing to note -- if I omit adding a jest configuration to the launch.json and just go with the default, it works properly (so it's specifically the variable substitution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external-dependency has dependency on external issues/fixes
Projects
None yet
Development

No branches or pull requests

2 participants