Tags
Language
Tags
April 2024
Su Mo Tu We Th Fr Sa
31 1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 1 2 3 4

Angular Test-Driven Development - Second Edition

Posted By: readerXXI
Angular Test-Driven Development - Second Edition

Angular Test-Driven Development - Second Edition
by Md. Ziaul Haq
English | 2017 | ISBN: 1786465477 | 246 Pages | ePUB/Mobi/Code Files | 6.3/8.4/0.5 MB

This is a complete guide that shows you testing techniques with Karma to perform unit testing and end-to-end testing with Protractor. It will show you how to optimize your Angular 2 development process using TDD techniques and ensure the final project is free of bugs.

We start by reviewing the TDD life cycle, TDD in the context of JavaScript, and various JavaScript test tools and frameworks. You will see how Karma and Protractor can make your life easier while running JavaScript unit tests. We will enable you to build a test suite for an Angular2 application and build a testable Angular2 medium-to-large scale application by handling REST API data.

Building on the initial foundational aspects, we move on to testing for multiple classes, partial views, location references, CSS, and the HTML element. In addition, we will explore how to use a headless browser with Karma. We will also configure a Karma file to automate the testing and tackle elements of Angular2 (components, services, classes, and broadcasting) using TDD.

Finally, you will find out how to pull data using an external API, set up and configure Protractor to use a standalone Selenium server, and set up Travis CI and Karma to test your application.

What you will learn:

- Get a clear overview of TDD in the context of JavaScript with a brief look at testing techniques, tools, and frameworks
- Get an overview of Karma and Protractor and create test suites for an Angular2 application with them
- Understand automated testing and implement headless automated tests with Karma
- Implement the testing techniques with mocks, broadcast events, and asynchronous behavior
- Integrate REST-based services and APIs into an application to extract data
- Automate Karma unit tests with Travis CI