Skip to content

Instantly share code, notes, and snippets.

@johannesschobel
Forked from toddwseattle/cloudSettings
Created August 6, 2019 09:35
Show Gist options
  • Save johannesschobel/c5f0678535ef92af979b1167595ce5b4 to your computer and use it in GitHub Desktop.
Save johannesschobel/c5f0678535ef92af979b1167595ce5b4 to your computer and use it in GitHub Desktop.
vscode debug configuration for an nx configuration with jest and vscode-jest extension
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
// -------
// this includes launching against chorme; but assumes you have done an ng serve
// in a command window
//
// the vscode-jest config let's you pick an nx configuration to launch.
//
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost:4200",
"url": "http://localhost:4200",
"webRoot": "${workspaceFolder}/apps/frameshare"
},
{
"name": "Debug Jest Tests",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/node_modules/@angular/cli/bin/ng",
"args": [
"test",
"${input:libName}",
"--runInBand=true",
"--codeCoverage=false"
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"trace": "all"
}
],
"inputs": [
// these options come from the names of your libraries as enumerated in nx.json..i manually put them in the pick list
{
"type": "pickString",
"id": "libName",
"description": "Which nx project to run jest tests to debug?",
"options": [
"frameshare",
"functions",
"material-uishared",
"user",
"frame",
"fbhelper",
"auth"
],
"default": "frameshare"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment