kolodny / safetest

MIT License
1.38k stars 34 forks source link

VSCode `launch.json` file example #34

Open klzns opened 6 months ago

klzns commented 6 months ago

Hi, nice project!

In the README it says:

Alternately you can add a launch.json file with these run properties and have vscode auto-attach to the process.

Can you provide this launch.json example? Currently is linking to a TODO.

Thanks!

klzns commented 6 months ago

I managed to make it work with:

{
  "name": "Run and debug Safetest",
  "type": "node",
  "request": "launch",
  "runtimeArgs": [
    "--inspect-brk",
    "${workspaceRoot}/node_modules/.bin/jest",
    "--runInBand",
    "--testMatch='**/*.safetest.{j,t}s{,x}'",
    "--setupFilesAfterEnv='<rootDir>/setup-safetest.ts'",
    "--watch"
  ],
  "console": "integratedTerminal",
  "internalConsoleOptions": "neverOpen",
  "env": {
    "OPT_URL": "http://localhost:3000/",
    "OPT_HEADED": "1"
  },
}