Skip to content

Instantly share code, notes, and snippets.

@harmandeep-singh
Created August 17, 2022 06:11
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 harmandeep-singh/5637d2e274bb56798ad1c0bbb3ecc822 to your computer and use it in GitHub Desktop.
Save harmandeep-singh/5637d2e274bb56798ad1c0bbb3ecc822 to your computer and use it in GitHub Desktop.
Launch.json for node app with jest single test file run prompt (dialogue box)
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Program",
"type": "node",
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"cwd": "${workspaceFolder}",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run-script",
"dev"
]
},
{
"name": "Debug Jest Tests",
"type": "node",
"request": "launch",
"runtimeArgs": [
"--inspect-brk",
"${workspaceRoot}/node_modules/jest/bin/jest.js",
"--runInBand"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},
{
"name": "Debug Jest Selected Test",
"type": "node",
"request": "launch",
"runtimeArgs": [
"--inspect-brk",
"${workspaceRoot}/node_modules/jest/bin/jest.js",
"--runInBand",
"--",
],
"args": ["${input:args}"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
] ,"inputs": [
{
"id": "args",
"type":"promptString",
"description": "Name of Test File E.G. : bigbang.test.js or bigbang",
"default": ""
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment