My Account Log in

1 option

Mastering Angular Test-Driven Development : Build High-Quality Angular Apps with Step-by-step Instructions and Practical Examples / Ezéchiel Amen Agbla.

O'Reilly Online Learning: Academic/Public Library Edition Available online

View online
Format:
Book
Author/Creator:
Agbla, Ezéchiel Amen, author.
Language:
English
Subjects (All):
JavaScript (Computer program language).
Web applications--Development.
Web applications.
Application software--Development.
Application software.
Physical Description:
1 online resource (246 pages)
Edition:
First edition.
Place of Publication:
Birmingham, England : Packt Publishing, [2024]
Biography/History:
AGBLA Ezechiel Amen: Ezechiel Amen AGBLA is passionate about web and mobile development, with expertise in Angular and Ionic. A certified Ionic and Angular expert developer, he shares his knowledge through courses, articles, webinars, and training. He uses his free time to help beginners and spread knowledge by writing articles, including via Openclassrooms, the leading online university in the French-speaking world. He also helps fellow developers on a part-time basis with code reviews, technical choices, and bug fixes. His dedication to continuous learning and experience sharing contributes to his growth as a developer and mentor.
Summary:
Do you want to learn how to build robust, reliable, and impressive Angular applications? If yes, then Angular test-driven development is for you! Mastering Angular Test-Driven Development is a comprehensive guide that provides you with essential resources to enhance your skills and deliver high-quality Angular applications. With a practical approach and real-world examples, the book extensively covers TDD concepts, techniques, and tools, going beyond unit testing to explore testing Angular pipes, forms, and reactive programming. In this book, you’ll learn how to validate and manipulate data using pipes, test Angular forms for input validation and user interactions, and handle asynchronous operations with reactive programming. Additionally, you’ll discover end-to-end testing using Protractor, Cypress, and Playwright frameworks, gaining valuable insights into writing robust tests for web applications, navigation, element interaction, and behavior validation. You’ll also understand how to integrate TDD with CI/CD, learning best practices for automating tests, deploying Angular applications, and achieving faster feedback loops. By the end of this book, you’ll be able to successfully implement TDD in your Angular projects with the help of practical examples, best practices, and clear explanations.
Contents:
Cover
Title Page
Copyright and Credits
Contributors
Table of Contents
Preface
Part 1: Getting Started with Test-Driven Development in Angular
Chapter 1: Taking Your First Steps with TDD
Technical requirements
Understanding TDD and its role in Angular
What is Angular and TDD?
The red-green-refactor cycle
Benefits of the red-green-refactor cycle
The role of TDD in Angular development
Setting up the development environment
Installing Node.js on Windows or macOS
Installing Node.js on Linux
Creating a new Angular project
Exploring different files related to writing tests
*.spec.ts files
The karma.conf.js file
The test.ts file
The tsconfig.spec.json file
The src/test.ts file
Summary
Chapter 2: Using Jasmine and Karma to Test Angular Applications
Mastering Jasmine's unit testing techniques
What is Jasmine?
Writing descriptive test suites
Choosing meaningful names
Structuring test suites
Writing clear and concise test descriptions
Maintaining and updating descriptive test suites
Writing your first unit tests in an Angular project
Utilizing code coverage and test result analysis with Karma
Code coverage visualization
Part 2: Writing Effective Unit Tests
Chapter 3: Writing Effective Unit Tests for Components, Services, and Directives
Advanced techniques for Angular unit testing - lifecycle hooks
Discovering lifecycle hooks
Practical application
Advanced techniques for Angular unit testing - Angular services
Testing service methods
Using rigorous directive testing to ensure proper rendering and functionality
Implementing color change directives
Writing tests for the colorChange directive
Summary.
Chapter 4: Mocking and Stubbing Dependencies in Angular Tests
Monitoring and controlling dependency calls using method stubs and spies
Method stubs and spies
Injecting mocked dependencies using TestBed providers
Handling async operations and complex scenarios
Understanding asynchronous operations
Handling asynchronous operations
Emphasizing the importance of testing async operations
Chapter 5: Testing Angular Pipes, Forms, and Reactive Programming
Testing an Angular pipe as used in our project
Positive number to percentage string formatting test
Negative number to percentage string formatting test
Decimal number to percentage string formatting test
Non-number to percentage string formatting test
Implementing TDD for the Reactive Form in our calculator app
Writing a test for the calculator form
Implementing the user interface
Writing tests for the calculator component
Part 3: End-to-End Testing
Chapter 6: Exploring End-to-End Testing with Protractor, Cypress, and Playwright
Understanding E2E testing
Discovering the benefits of E2E testing
Exploring different approaches to E2E testing
Comparison between script-based testing and exploratory testing
Harnessing the power of E2E testing tools
Analyzing the benefits of E2E testing in a project
Exploring Protractor, Cypress, and Playwright for E2E testing
Protractor
Cypress
Playwright
Chapter 7: Understanding Cypress and its Role in End-to-End Web Applications
Discovering Cypress and its role in an Angular project
Understanding Cypress
Seamless integration with Angular
Efficient testing workflow
Real-time reloading and debugging.
Setting up Cypress in our Angular project
Installing Cypress
Configuring Cypress
Writing your first E2E test
Chapter 8: Writing Effective End-to-End Component Tests with Cypress
Structuring E2E tests
Writing test cases
Addition context
Subtraction context
Multiplication context
Division context
Using Cypress custom commands
Part 4: Continuous Integration and Continuous Deployment for Angular Applications
Chapter 9: Understanding Continuous Integration and Continuous Deployment (CI/CD)
Understanding CI and CD
What is CI?
Benefits of CI for development teams
Key principles of CI implementation
What is CD?
Benefits of CD for development teams
Key principles of CD implementation
Setting up CI/CD pipelines for automating build with GitHub Actions
Step 1 - create or choose a repository and project
Step 2 - open GitHub Actions in your project repository
Step 3 - define your CI/CD workflow
Setting up CI/CD pipelines for automating tests with GitHub Actions
Setting up CI/CD pipelines for automating the deployment process with GitHub Actions
Chapter 10: Best Practices and Patterns for Angular TDD
Best practices for TDD in Angular projects
Exploring patterns for implementing TDD in any Angular project
Choosing a TDD pattern for your Angular project
Chapter 11: Refactoring and Improving Angular Code through TDD
Refactoring Angular code with TDD
The power of the test-first approach
Benefits of TDD in refactoring
Examples in action
Choosing the right tests to write
Identifying code smells and areas for improvement in Angular applications
What are code smells?
Why should we care about code smells in Angular?.
Identifying the most common code smells in Angular applications
Iterative improvement - red-green-refactor cycle for continuous code enhancement
Red - setting the stage with failing tests
Green - making the test pass with minimal code
Refactor - transforming the code with confidence
Index
Other Books You May Enjoy.
Notes:
Description based upon print version of record.
Technical requirements
Description based on publisher supplied metadata and other sources.
Description based on print version record.
ISBN:
9781805127932
1805127934
OCLC:
1446133910

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

Find

Home Release notes

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Find catalog Using Articles+ Using your account