1
votes

From the online definition:

Karma: is a tool which spawns a web server that executes source code against test code for each of the browsers connected. The results of each test against each browser are examined and displayed via the command line to the developer.

Jasmine: is a development framework for testing js code. It does not depend on any other JavaScript frameworks. It does not require a DOM. And it has a clean, obvious syntax so that you can easily write tests.

My question is, does Karma require Jasmine to run, does Karma depend on Jasmine since Jasmine is a framework and Karma is a tool which runs on that framework and runs the written tests?

I'm using both of them with my angular2 project.

2
So the answer to my question is yes? Karma really does depend on Jasmine?and can not go without it? - masterach
Yes the answer is yes. Jasmine does It ships with an HTML test runner that executes tests in the browser. Karma use this browser to show results. Or you totally need to rewrite karma so that it show the output of the console only. - Swoox
You can post that as an answer if you wish to gain points. I got it now - masterach
Nah it's fine I'm here to help not to gain points. - Swoox

2 Answers

2
votes

Karma is client-side test runner and doesn't depend on Jasmine. It can run without any testing framework at all.

It has plugins for major testing frameworks, including Jasmine and Mocha.

2
votes

Yes, Jasmine and Karma can co-exist.

  • Jasmine is a javascript based framework that we use to write unit
    test cases. Alternative to jasmine is Mocha.
  • Karma is a test runner, which runs unit test cases on browser. And It can be used with all type of unit test frameworks. And It's easy to integrate with all CI tools like Bamboo and Jenkins.