1

When i want to execute tests in intelliJ for javascript (Jasmine - karma) I have to open the IntelliJ console and digit the command as in a normal console (grunt karma:tests). I wait, and get all the test result. But in a GUI enviroment, running from command line is not the best. I can do that without need of IntelliJ.

In addition, in one target there are 900 unit tests, when i have to change one UT i have to wait 20 sec. Every time i make a change on one test, i have to run them all.

When an error is present, i have to read the output of the console, that is a nightmare.

That's REALLY very annoying.

In Eclipse it is quite easy to run tests from one page (without need of running all tests of a target), and every test is highlighted in red (failed) or green (passed).

I searched online, and seems that the equivalent for IntelliJ is "Test Runner Tab". I have it installed, i suppose, but... how to display it? Where to click?

Thanks

fresko
  • 1,890
  • 2
  • 24
  • 25
  • Did you already read the IJ help sections for [running unit tests on karma](https://www.jetbrains.com/help/idea/2016.3/running-unit-tests-on-karma.html) and [test runner tab](https://www.jetbrains.com/help/idea/2016.3/test-runner-tab.html)? – Morfic Nov 29 '16 at 15:32

1 Answers1

0

Hej, I found the solution thanks to a collegue.

@Morfic: Yes. I searched in many places but the problem was Karma itself. Sometimes it's not difficult to find, but to search...

In short: the installation of karma used by IntelliJ must not be global - for what i understood. But seee the link at the bottom of my answer to have more details.

For me, it was enough to run the following command:

npm uninstall -g karma

I already had installed karma non-globally. Then in the settings of IntelliJ i choose the local installation.

After that, clicking on the "play" green button, the tests started magically, without need of any setting or searching any window.

If I woudn't have the non-global version installed I would need also the following command:

npm install karma --save-dev

More details are in the following:

Community
  • 1
  • 1
fresko
  • 1,890
  • 2
  • 24
  • 25