Why Jasmine?
Now that we have seen some JavaScript unit tests in action, let us take a step back. Why would we use Jasmine and are there any alternatives? Jasmine works well with Karma, a test runner we will use later in this chapter. Karma was created by the Angular.js team, and thus Angular.js, Jasmine, and Karma are a pretty good match.
You do need to realize that Jasmine is not your only choice, but since we are working with Angular.js, it is a recommended choice. Other testing libraries include QUnit, used by the jQuery team, Unit.js, Intern, and Mocha. There are a pretty much a gazillion unit testing libraries out there though, but these ones are pretty popular choices.
I do not wish to confuse you, but you should be aware that some ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access