japa-vscode icon indicating copy to clipboard operation
japa-vscode copied to clipboard

[Feature Request] Run test in debug mode

Open OmarDST opened this issue 1 year ago • 3 comments

It would be nice to have option to run the test in debug mode just like vitest

currently, I have to manually copy the test script command after clicking "Run test" via Code Lense and run it using vs code built in JavaScript Debug Terminal which works wonderfully.

The extension should add another text in the Code Lenses like "Run test debug" next to "Run test" text and this should run the test script command using vs code built in JavaScript Debug Terminal.

This should be applicable to when running the test via VS Code Test Explorer

OmarDST avatar Aug 29 '24 01:08 OmarDST

+1 vote. Would love that option

tom-thorne avatar Oct 26 '24 11:10 tom-thorne

It would be sweet if this was implemented, there's a quick workaround to do this in the meantime:

000329@2x

Debugging a Specific Test in Visual Studio Code

Follow these steps to debug a specific test in Visual Studio Code:


1. Add a Debug Configuration

  1. Open the Command Palette by pressing Ctrl + Shift + P or Cmd + Shift + P (on macOS).
  2. Type Debug: Add Configuration and select it.
  3. Add the following configuration in your launch.json file:
{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "test:selectedText",
      "program": "${workspaceFolder}/ace.js",
      "args": [
        "test",
        "--files",
        "${relativeFile}",
        "--tests",
        "${selectedText}"
      ],
      "skipFiles": [
        "<node_internals>/**"
      ]
    }
  ]
} 

cc @OmarDST @tom-thorne @Julien-R44 in case its helpful

eduwass avatar Nov 29 '24 03:11 eduwass

This is a decent work around, thanks.

would be lovely to have this built in to the extension!

NullVoxPopuli avatar Dec 15 '24 18:12 NullVoxPopuli