I'm looking to debug my Typescript spec.ts
file using vs-code
. Typically, I run it from the terminal like this:
npm run test:unit -- page.spec.ts
But I want to add some console.log
statements for debugging. Is there a way to do this in vs-code?
When I run this npm command in the terminal, it seems to be executing a script defined in package.json:
"test:unit": "ngcc && jest --coverage --ci --config=jest.conf.json"
So, I'm not sure how to run this in debug mode.
All the resources I've found online are either using mocha
or testing in a browser
, while I just want to debug simple unit tests.
If anyone has any tips or suggestions on how to achieve this, I'd greatly appreciate it.