Overview
Explore best practices for testing Angular applications in this conference talk from ng-conf. Learn why writing tests is crucial, how to leverage Angular CLI for testing, and techniques for handling asynchronous tests. Dive into practical demonstrations, including a delayed echo server and debounced echo server, to understand common testing challenges. Discover solutions for long promise chains, working with timers, and testing XHR/HttpClient interactions. Gain insights into unit testing, asynchronous testing in Protractor, and using async/await in tests. Understand the benefits of AOT testing and component harnesses to improve your Angular application's reliability and maintainability.
Syllabus
Intro
Why do we write tests?
Testing in Angular
Testing using Angular CLI
Asynchronous Tests
Demo: Delayed Echo Server
Let's start to test
Problem with Jasmine done
Jasmine done fail
async helper
Problem: Long promise chains
Timer
Demo: Debounced Echo Server
How to test that?
Test Demo
XHR(HttpClient)
Demo: XHR Echo Server
Http Testing Controller
Summary
More about unit test
Async in Protractor
Disable control flow
Use async/await in test
AOT Test
Component harness
To Summarize...
Taught by
ng-conf