When comparing Karma vs Jasmine, the Slant community recommends Jasmine for most people. In the question“What are the best JavaScript unit testing tools?” Jasmine is ranked 2nd while Karma is ranked 4th. The most important reason people chose Jasmine is:
If you prefer your test cases and applications to be developed from the perspective of your stake holders, Jasmine is the framework for you.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Easily extensible
Do you prefer other test frameworks such as Mocha, Jasmine, qUnit or any other framework? Well you're in luck as Karma can be easiliy be extended to wrap around ANY framework of your choice.
Pro Provides both Browser based testing as well as headless tests
Karma eases out the UI testing process as you can test your code on all your devices let it be smartphones, tablets or your very own desktop. If you don't want all of that, you always have the option of headless testing using a PhantomJS instance.
Pro Provides the option of running client/servers either separately or on the Development computer
These options are really helpful in cases, where you have the luxury of multiple machines (tablets, mobile phones desktops) around you.
Pro You can test your code in cross browser environments
Being able to test your code directly via your testing tool is a breeze! You don't need to download a fancy tool to see how your app looks in a number of different browsers, now that Karma would do the job for you.
Pro Has plugins for WebStorm and is supported by the Netbeans IDE
Thanks to Karma, you won't need to spawn up a new terminal just so that you can test your app, you can now code and test right from the IDE
Pro Behaviour Driven Development focused
If you prefer your test cases and applications to be developed from the perspective of your stake holders, Jasmine is the framework for you.
Pro Easy to find Jasmine tutorials for most MV* frameworks,
whilst Mocha is still considered the new kid on the block.
Pro Has a very readable and user-friendly syntax
Code readability is an important factor, if the application development involves multiple teams; if the testing team is unable to read your test cases then they won't be able to test it. Jasmine resolves this issue by providing developers with an extremely simple and "human-friendly" syntax.
Pro Allows both DOM-less as well as asynchronous testing
If you have some test cases that do not involve testing of DOM elements or events, those are exactly the ones where you want to use Jasmine. It'll provide smooth, simple and easy DOM-less testing of those test cases.
Pro Integrates very well with Ruby on Rails
The jasmine-rails gem allows you to run Jasmine specs in a browser (powered by Rails engine mounted into your application).
Cons
Con No Support for NodeJS testing
Currently Karma doesn't support testing of apps built on NodeJS. So if you have a node app, you don't want to use Karma, Mocha or Jasmine can do the job for you.
Con No plugin for Eclipse (yet)
Do most of your code using Eclipse, well, you're in bad luck. Karma doesn't have an eclipse plugin, though if you are a real die hard eclipse fan, you can see this little hack to be able to run Karma from inside Eclipse Link
(Time of writing: July 2014)
Con Maintainers are not very responsive to pull requests
Pivotal aren't responsive to pull requests, though they have made repo changes within < 3 months