Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run a single test file with Karma/Jasmine?

I'm using Karma and Jasmine for testing my Angular JS code. I managed to run all the tests in my project using Karma, but if I try to run just a single file I'm getting the following error: ReferenceError: describe is not defined. Is it possible to run just a single test file and if yes then how?

P.S. I'm using Intellij IDEA.

like image 955
Anton Belev Avatar asked Sep 15 '15 16:09

Anton Belev


1 Answers

Although it's not ideal, you can replace describe (and it) with fdescribe (and fit) so only those tests will be executed

On the other hand, xdescribe / xit excludes the tests from your suite

If you use Gulp, you can combine gulp-karma & yargs to pass in a pattern as argument.

source: https://stackoverflow.com/a/27696472/1782659

like image 79
Pieter Willaert Avatar answered Sep 18 '22 12:09

Pieter Willaert