The Angular 2 framework is great for building large-scale web applications that can be maintained and extended. And when you're building enterprise-level apps, testing is vital to the development process. Testing improves the quality of code and reduces maintenance, saving both time and money. Even though testing is crucial, it's sometimes neglected since there are few established resources and standards when it comes to modern JavaScript web applications. Developers who know how to build and leverage tests are highly valued by their clients and companies.
Table of Contents detailed table of contents
1. Introduction to Testing Angular Applications
1.1. Angular 2 Testing Overview
1.2. Getting to know TypeScript
1.3. Types of Tests
1.4. End-to-End Tests
1.5. Summary
Part 1: Getting Started
2. Creating Your First Tests
2.1. Setting up our initial environment
2.1.1. Installing Node.js and npm
2.1.2. Installing Jasmine
2.2. Writing basic tests using Jasmine
2.2.1. Setting up the test runner
2.2.2. Writing basic tests
2.3. Installing additional dependencies
2.3.1. Installing Typescript
2.3.2. Installing other dependencies
2.4. Testing Classes
2.5. Summary
3. Testing Components
3.1. Get to Know Components
3.1.1. What is a Component
3.1.2. The differences between Components and Directives
3.1.3. Creating components
3.2. Testing Components
3.2.1. Basic Tests
3.2.2. Matchers
3.2.3. Additional Tests
3.3. Summary
Part 2: Unit Testing
4. Testing Directives
4.1. What are directives?
4.1.1. Attribute directives
4.1.2. Structural directives
4.1.3. Our directvies
4.2. Setting up our tests
4.2.1. Introducing the Angular CLI
4.3. Testing Attribute Directives
4.3.1. Introducing the Favorite Icon Directive
4.3.2. Creating our tests for the Favorite Icon directive
4.4. Testing Structural Directives
4.4.1. Introducing the Show Contacts Directive
4.4.2. Creating our tests for the Show Contacts directive
4.5. Quiz
4.6. Conclusion
5. Testing Pipes
6. Testing Services
7. Testing Routing
Part 3: End-to-End Testing
8. Interacting with Elements
9. Testing Forms
10. Advanced Topics
Appendixes
Appendix A: Additional Resources
About the book
Testing Angular Applications is an example-rich, hands-on guide that gives you the real-world techniques you need to thoroughly test all parts of your Angular 2 applications. You'll start with an introduction to Angular 2, TypeScript, testing fundamentals, and the testing frameworks and tools used in the book and begin writing your first tests. Next, you'll learn how to set-up your Angular 2 environment, including TypeScript and the Angular 2 dependencies and you'll create your first component. The second part of the book focuses on the most important concepts of Angular 2, such as testing components, directives, pipes, services, and routing. By the end of this book, you'll be able to confidently write unit and end-to-end tests for Angular 2 applications in TypeScript.What's inside
- Getting to know TypeScript
- Writing and debugging tests
- Testing components, directives, services and pipes
- Unit testing
- End-to-end testing
Manning Early Access Program (MEAP) Read chapters as they are written, get the finished eBook as soon as it’s ready, and receive the pBook long before it's in bookstores.
Buy
- MEAP combo $44.99 pBook + eBook
- MEAP eBook $35.99 pdf + ePub + kindle
FREE domestic shipping on three or more pBooks