O'Reilly logo

Learning Angular for .NET Developers by Rajesh Gunasundaram

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

Introducing Jasmine

Jasmine is an open source framework that is used to test JavaScript code without any dependency on DOM. As Angular is loosely coupled, we can use the Jasmine framework to test Angular components, services, and so on. Independent of each other, the clean syntax of Jasmine enables you to write tests very easily.

A global function named describe is the starting point of the Jasmine function. This global function takes a function and two parameters of type string. The string parameter describes the tests, and the function will have the actual implementation of testing:

describe("short description about the test suite", function() { 
}); 

The actual test methods are defined by a global function called the it function, which ...

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