O'Reilly logo

Angular Test-Driven Development - Second Edition by Md. Ziaul Haq

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Say hello to Jasmine test suite

As long as we have to use a testing framework to build a test suite, there are some basic and common assertions on all frameworks. It's important to understand those assertions and spies and when to use them.

In this section we will explain the assertions and spies from Jasmine, as Jasmine will be our testing framework throughout the book.

Suites

Any test suite begins with a global Jasmine describe function, which receives two parameters. The first one is a string and the second one is a function. The string is the suite name/title, and the function is for the code block that will be implemented in the suite.

Consider the following example:

describe("A sample test suite to test jasmine assertion", function() { // .. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required