Need advice about which tool to choose?Ask the StackShare community!
Jasmine vs Karma: What are the differences?
What is Jasmine? DOM-less simple JavaScript testing framework. Jasmine is a Behavior Driven Development testing framework for JavaScript. It does not rely on browsers, DOM, or any JavaScript framework. Thus it's suited for websites, Node.js projects, or anywhere that JavaScript can run.
What is Karma? Spectacular Test Runner for JavaScript. Karma is not a testing framework, nor an assertion library. Karma just launches a HTTP server, and generates the test runner HTML file you probably already know from your favourite testing framework. So for testing purposes you can use pretty much anything you like.
Jasmine can be classified as a tool in the "Javascript Testing Framework" category, while Karma is grouped under "Browser Testing".
"Can also be used for tdd " is the primary reason why developers consider Jasmine over the competitors, whereas "Test Runner" was stated as the key factor in picking Karma.
Jasmine and Karma are both open source tools. Jasmine with 14.4K GitHub stars and 2.12K forks on GitHub appears to be more popular than Karma with 10.7K GitHub stars and 1.61K GitHub forks.
According to the StackShare community, Jasmine has a broader approval, being mentioned in 143 company stacks & 75 developers stacks; compared to Karma, which is listed in 119 company stacks and 57 developer stacks.
We use Mocha for our FDA verification testing. It's integrated into Meteor, our upstream web application framework. We like how battle tested it is, its' syntax, its' options of reporters, and countless other features. Most everybody can agree on mocha, and that gets us half-way through our FDA verification and validation (V&V) testing strategy.
Pros of Jasmine
- Can also be used for tdd64
- Open source49
- Originally from RSpec18
- Great community15
- No dependencies, not even DOM14
- Easy to setup10
- Simple8
- Created by Pivotal-Labs3
- Works with KarmaJs2
- Jasmine is faster than selenium in angular application1
- SpyOn to fake calls1
- Async and promises are easy calls with "done"1
Pros of Karma
- Test Runner61
- Open source35
- Continuous Integration27
- Great for running tests22
- Test on Real Devices18
- Backed by google11
- Easy Debugging5
- Remote Control2
Sign up to add or upvote prosMake informed product decisions
Cons of Jasmine
- Unfriendly error logs2
Cons of Karma
- Slow, because tests are run in a real browser1
- Requires the use of hacks to find tests dynamically1