Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering TypeScript 3

You're reading from   Mastering TypeScript 3 Build enterprise-ready, industrial-strength web applications using TypeScript 3 and modern frameworks

Arrow left icon
Product type Paperback
Published in Feb 2019
Publisher Packt
ISBN-13 9781789536706
Length 694 pages
Edition 3rd Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Nathan Rozentals Nathan Rozentals
Author Profile Icon Nathan Rozentals
Nathan Rozentals
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. TypeScript Tools and Framework Options FREE CHAPTER 2. Types, Variables, and Function Techniques 3. Interfaces, Classes, and Inheritance 4. Decorators, Generics, and Asynchronous Features 5. Declaration Files and Strict Compiler Options 6. Third-Party Libraries 7. TypeScript Compatible Frameworks 8. Test-Driven Development 9. Testing Typescript Compatible Frameworks 10. Modularization 11. Object-Oriented Programming 12. Dependency Injection 13. Building Applications 14. Let's Get Our Hands Dirty 15. Other Books You May Enjoy

Angular testing

In this section, we will take a look at unit tests for our existing Angular application, similar to what we have done with Backbone and Aurelia.

Angular test setup

When creating a project using the Angular-CLI (by issuing an ng new command), the default project setup already includes all of the boilerplate code to run unit tests using Karma, and end-to-end tests using Protractor. This default setup is a very handy feature of Angular, shortening the development effort of configuring a test environment, and giving us the ability to dive right in and write tests from the beginning of a project.

To run unit tests using Karma, we can type the following from the command line:

ng test 

This command-line option will...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime