Posts

Showing posts from January, 2017

AngularJS Tutorial: Unit Testing Angular Applications Using Jasmine and Karma

Image
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 run in background and restart when you save your code. Adding Karma to AngularJS project As a first step, we’ll add test automation to our project. To streamline testing of Angular applications, Google created a special test automation framework called Karma which in turn can rely on various testing frameworks such as Jasmine and run tests any time you save a file in your project. To add Karma and other tools necessary for testing to the project it is necessary to execute the following command. npm install karma karma-jasmine karma-chrome-launcher jasmine-core angular-mocks --save-dev We added several de...

AngularJS Tutorial: Introduction to End-to-End Testing of AngularJS Applications using Jasmine and Protractor

Introduction to software testing In the previous installment of this series we discussed how to create a simple Hello World application using AngularJS. In this tutorial you will start learning how to streamline the development process and would tools Angular offers to the developers. When project is under active development, new features are often added to it and some previously created features are modified. It is possible that some application functionality is broken in the process. To prevent this from happening, it is a good idea to check how all the functionality works after modifications but that could be difficult because one should remember all the cases for all the features added since the beginning. Also, it’s tedious to manually place your application into various conditions and see if it works, so one can rely on automation, that is one can record all the tests in a format that computers can understand and delegate the menial task of testing to a computer. Ch...