skip to content
Alvin Lucillo

Debug specific test

/ 1 min read

💻 Tech

In launch.json, you can use the configuration below so you can debug a specific test. For example, the configuration below runs the TestGenerateDBExport function under integration_test folder. When I press F5 on VS Code, the program will stop at the breakpoints I set in this test.

    "configurations": [
      {
        "name": "Run Specific Go Test",
        "type": "go",
        "request": "launch",
        "mode": "test",
        "program": "${workspaceFolder}/integration_test",
        "args": ["-test.v", "-test.run", "TestGenerateDBExport"]
      }
    ]