Unit Testing In Angular

Posted By: ELK1nG

Unit Testing In Angular
Published 11/2024
MP4 | Video: h264, 1920x1080 | Audio: AAC, 44.1 KHz
Language: English | Size: 1.26 GB | Duration: 1h 55m

Master Angular Unit Testing : From Testing Async Operations, Lifecycle Hooks to services, pipes and directives

What you'll learn

Master Unit Testing in Angular : Students will learn how to write, run, and maintain unit tests for Angular components, services, and pipes.

Effectively Test Asynchronous Code : Learners will understand how to test asynchronous operations, including HTTP requests, Observables and Promises.

Learn to test real world angular application using JASMINE and KARMA.

Student will learn how to do test coverage, mock dependencies and eventually write better code.

Requirements

Basic Understanding of Angular

Basic JavaScript or TypeScript Knowledge

Description

Unlock the full potential of Angular Unit testing with this comprehensive course focused on Advanced Component Testing. Designed for developers who want to build reliable, maintainable, and well-tested Angular applications, this course dives deep into unit testing, dependency injection, async testing, component lifecycle hooks, and more.Throughout the course, you'll learn step-by-step how to set up testing environments, mock services, and test complex components that interact with services and handle asynchronous operations. We’ll explore hands-on scenarios to help you understand how to test each component thoroughly, ensuring high code quality and performance. By the end of this course, you’ll be fully equipped to write robust test cases for your Angular applications, enabling you to detect issues early and improve development efficiency.Key Topics Covered in this course are:Testing Components with Dependency Injection: Learn how to test components that rely on services, using mock services and testing their interactions.Async Operations: Dive into testing components with asynchronous behavior, including setTimeout functions and async calls.Lifecycle Hooks: Master testing for lifecycle hooks like ngOnInit and ngOnDestroy, ideal for components with initialization logic.Custom Directives and Pipes: Understand how to test custom directives and pipes to enhance the user interface and streamline your code.

Overview

Section 1: Introduction to Angular Testing

Lecture 1 Overview of the Course

Lecture 2 About the Instructor

Lecture 3 What is Unit Testing?

Lecture 4 Introduction to Jasmine & Karma

Section 2: Getting Started With Task Manager Application

Lecture 5 Introduction to the 'Task Manager' application

Lecture 6 Setting up the Application/VS-Code/ GitHub

Lecture 7 Brief overview of spec.ts file (testing file)

Lecture 8 Writing Your First Test: Exploring describe, it, and expect

Lecture 9 Testing Subtraction, Division, Error Handling, and Using fdescribe

Lecture 10 beforeEach

Lecture 11 afterEach, beforeAll, afterAll (Jasmine testing functions)

Lecture 12 Code Coverage: What, Why, and How to Achieve It

Section 3: Testing Components in Angular

Lecture 13 Application Overview: Code Structure & Connections (Components & Services)

Lecture 14 Component Testing (TestBed, async & await)

Lecture 15 Testing @Input() by mocking object

Lecture 16 Testing @Output() using spyOn

Section 4: Advanced Component / Services Testing

Lecture 17 Angular Form Testing

Lecture 18 Testing Button State (disabled) with Form Inputs

Lecture 19 Handling Asynchronous Behavior with setTimeout (async/await)

Lecture 20 Testing Observables$, ngOnInit & spy over task serice

Section 5: Test Custom Directives

Lecture 21 Setting up a Custome directive (HighLightDirective)

Lecture 22 Testing highlight.directive.spec.ts

Section 6: Test Custom Pipe

Lecture 23 Setting up ExclamationPipe

Lecture 24 Testing ExclamationPipe.spec.ts

Angular Developers Looking to Master Testing,Anyone Looking to Build Robust Angular Applications,All developers looking to learn unit testing