TypeScript application wants tests to be written in TypeScript as well, right?
There is a great library to achive this: jasmine-ts
But how to debug such tests within your IntelliJ IDE?
You need to use the Node.js plugin and configure it to run/debug the
jasmine-ts like following:
I'm developing under Windows, but for Mac or Linux would be the situation almost the same.
The meaning of the settings is following:
- Working directory is the location of my TypeScript project, generally it the directory where your Jasmine configuration is located.
jasmine-tsbootstrap file. My local
npmrepository is located in my home ordner under
AppData\Roaming\npm\node_modules, this is the folder where
jasmine-tsis installed into.
- Application parameters are used to debug a concrete test suite. If you want to debug all the Jasmine tests, leave this field empty. In my case, all my Jasmine test files are located under the
testsub-folder in my project directory.
Then just set up some breakpoints and click the Run/Debug button.
Here we go...