Home » Jasmine

Tag Archives: Jasmine

AngularJS Tutorial: Unit Testing Angular Applications Using Jasmine and Karma

In the previous installment of this series we’ve learned how to perform End-to-End application testing using Jasmine and Protractor. In this part, we’ll discuss how to test controllers and how to automate this process. In fact, running tests manually may make the whole process tedious and may prompt one not to use tests altogether, so we’ll learn how to make test ...

Read More »

AngularJS Unit Testing With Karma and Jasmine

One of the benefits of using AngularJS is that it is designed with testability in mind. Having integrated unit testing can help prevent bugs as projects grow in complexity and the number of developers. It also provides new devs with documentation on how to use existing code. In my last article, I explained how to use Test-Driven Development (TDD) to ...

Read More »

AngularJS Integration Tests with Mocks and Magic

As a web developer I’m not a huge fan of full end-to-end tests. My opinion is changing with maturing frameworks like protractor but I still think looking for a “button” with an “id” is a fragile test that may have to change often. I am far more interested in what happens when the button is clicked than the button itself, ...

Read More »

Avoid test code duplication in Jasmine tests

Test code has to be treated like production code. Obviously we cannot charge the customer for it, it’s something that helps us developers to make sure we keep our codebase healthy, which ultimately is the responsibility we have towards our customers. Thus we need to apply the same best practices principles as we do for our production code, where, code ...

Read More »

Unit Test AngularJS Controller With Jasmine

Last time I demonstrated how to Consume RESTful API With Angular-HAL, and now I want to show you how to unit test my AngularJS controller code withJasmine, a behavior-driven development framework for testing JavaScript code. BDD and Jasmine I’m a big fan of Test-Driven Development (TDD). And I always want to write unit test for my code. But not everyone ...

Read More »