Skip to content

Instantly share code, notes, and snippets.

@nflaig
Last active April 3, 2024 22:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nflaig/49c3a4541f4e06fc9474ac51a169b0ad to your computer and use it in GitHub Desktop.
Save nflaig/49c3a4541f4e06fc9474ac51a169b0ad to your computer and use it in GitHub Desktop.
Debug Lodestar tests in currently selected file using VS code, requires https://marketplace.visualstudio.com/items?itemName=rioj7.command-variable
{
"version": "0.2.0",
"configurations": [
{
"name": "Test Current File",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/node_modules/.bin/vitest",
"args": ["--run", "${file}", "-t", "${input:testName}"],
"cwd": "${workspaceFolder}/${input:packageName}",
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"]
}
],
"inputs": [
{
"id": "packageName",
"type": "command",
"command": "extension.commandvariable.transform",
"args": {
"text": "${relativeFileDirname}",
"find": "^(packages/[^/]+).*",
"replace": "$1"
}
},
{
"id": "testName",
"type": "promptString",
"description": "Enter the test name to run, leave empty to run all"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment