Will's Blog

Will's Blog

Stupid simple debugging of JavaScript tests in VSCode

Hmmm

I was going through the various articles throughout the web to figure out how to setup testing.

"Open up your launch.config..."

"Type a bunch of various junk"

Or like all things keep going until you find something stupid simple.

Stupid Simple Method

Open up your VSCode instance.

Open your package.json file

Notice the icon VSCode puts above the scripts block.

Click it.

Select the script that you have created to run your tests from the command line.

Done.

image.png

After going through that process the first time, you can go into your terminal (ctrl+`) and run your command line npm run test/yarn test and it will attach a debugger automatically. Even easier!

#debugging#vscode#javascript#typescript
 
Share this