Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Effective Angular

You're reading from   Effective Angular Develop applications of any size by effectively using Angular with Nx, RxJS, NgRx, and Cypress

Arrow left icon
Product type Paperback
Published in Aug 2024
Publisher Packt
ISBN-13 9781805125532
Length 400 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Roberto Heckers Roberto Heckers
Author Profile Icon Roberto Heckers
Roberto Heckers
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

Preface 1. Part 1:Angular Basics and Setting Up Scalable Nx Workspaces FREE CHAPTER
2. Chapter 1: Scalable Front-End Architecture for Angular Applications 3. Chapter 2: Powerful Angular Features 4. Chapter 3: Enhancing Your Applications with Directives, Pipes, and Animations 5. Chapter 4: Building Forms Like a Pro 6. Part 2:Handling Application State and Writing Cleaner, More Scalable Code
7. Chapter 5: Creating Dynamic Angular Components 8. Chapter 6: Applying Code Conventions and Design Patterns in Angular 9. Chapter 7: Mastering Reactive Programming in Angular 10. Chapter 8: Handling Application State with Grace 11. Part 3:Getting Ready for Production with Automated Tests, Performance, Security, and Accessibility
12. Chapter 9: Enhancing the Performance and Security of Angular Applications 13. Chapter 10: Internationalization, Localization, and Accessibility of Angular Applications 14. Chapter 11: Testing Angular Applications 15. Chapter 12: Deploying Angular Applications 16. Index 17. Other Books You May Enjoy

Unit testing of Angular applications using Jest

When you add an Angular project to your Nx monorepo, the application is set up to use Jest as a test runner by default. Jest is a testing framework commonly used to write and run automated unit tests for JavaScript and TypeScript-based applications. This section will give you hands-on experience writing unit tests for your Angular application using Jest. Before you start writing tests, let’s expand upon the default configuration Nx provided to make your testing experience better.

Setting the coverage threshold

The first thing you want to add in the Jest configuration is a coverage threshold for the minimum required percentage of lines, functions, and branches that unit tests should cover. A commonly used percentage is 80%, but you can set the coverage percentages to whatever you and your team deem enough to make you confident that new changes won’t break existing code. You can add the global configurations for testing...

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 €18.99/month. Cancel anytime