Angular Developer Testing: topics
Buzzwords Covered
- Unit Testing
- Integration Testing
- End-To-End Testing
- Test Doubles (Mocks, Stubs, Fakes, etc.)
- Automated Testing in Pipelines
- Accessibility
- Additional Technologies Demonstrated or Used In Class:
- Vitest Testing Framework
- Playwright Testing Framework
Learn Low-Level Unit Testing, Including Test-First and Test-Driven Development
We will start building our tool belt of developer testing techniques. This module will teach low-level testing to verify complex algorithms and interactions in “white box” testing. Developers will learn techniques to test code with dependencies using mocks, stubs, and dummies, designing complex code with Test-Driven Development, and good test-fixture design using Vitest.
Write Isolated Integration Tests for Angular Components and Full Applications
While low-level Unit tests are helpful, they can cause issues with code maintainability, and still leave “holes” of untested code. We will learn to create increasingly higher-level tests to ensure our components and our application meets our understanding of the requirements. Developers will learn to use the Angular Testing Library to create component tests that exercise the component in a variety of scenarios. We will also use Playwright for tests that run the whole application in a real browser.
Understand the Role of Developer Testing in Overall Application Delivery
Now that we know the options available to test our Angular applications as developers, we will learn how to create (or discover) the best testing plan to ensure that when our code is committed and run through the gauntlet of automated tests, we are doing all we can to confidently move our code to the next environment while providing the flexibility to allow us to refactor, learn, and change our code over time as new technical and business requirements are introduced.
Automated Testing: Locally and in Build and Test Pipelines
Developers will learn to create an automated process for linting, building, unit testing, and (isolated) integration testing their Angular applications. We will create
gitpre-commit hooks to ensure our code meets quality standards before pushing our code for others, and learn to build our code and run the tests in our pipeline.
Create a Testing Plan for your Angular Applications that Grows in its Comprehensiveness with Feedback from Software Testers
Using the feedback provided by our build and test pipelines, we will learn to adjust our testing strategy to ensure smooth and quick delivery of our code while maintaining and even increasing the quality without losing the flexibility we need to meet the needs of the business.
Extract Heavily Tested, Stable Features to Libraries
The best way to streamline your test pipelines over time is to identify the areas of your application that should be extracted to a shared library. We will learn how to extract useful functionality into an Angular library, create an improved test plan for the library, and deliver it using npm.
Feature Toggles and CI/CD with Angular
With Continuous Integration (CI), we need to work on and test features that may not be released yet, without long-lived branches. We will learn how to create tests for features that are in the hypothesis stage, and make them ready for release when it is time.
Expecting Chaos: Developer Testing for Failures Outside of Your Application
Isolated Integration Tests allow us to simulate expected challenges in the production environment, including network failures, authentication issues, etc. We will do exploratory testing to discover risky paths in our code, develop mitigations, and deploy the tests to our pipeline.
Automated Accessibility Testing
We will take a brief look at automated Accessibility testing of our Angular applications, and how to use integration tests to check your applications meet accessibility requirements, including color contrast, and keyboard access.