Module 10 of 10

Testing, Build & Deployment

Lessons

About This Module

Building the app is only part of the job. Before users see it, you need to know it works, package it for production, and put it somewhere people can reach it. This module covers that last stretch: testing, the build, and deployment.

It starts with unit testing in Angular, using Jasmine to write tests and Karma to run them in a browser, with TestBed to set up components and services for testing and spies to replace real dependencies. From there it covers the production build with ng build, which compiles and optimizes your app into static files in the dist folder, and deploying those files to a server. Hosts that serve static sites, such as Firebase Hosting, Netlify, and GitHub Pages, are common choices. Whatever you pick, the server must send index.html for every route so Angular routing keeps working.

Some of these videos were recorded for earlier Angular versions, so commands like ng build --prod are now written as ng build --configuration production, and the test runner setup may differ in newer projects. The ideas behind testing and deployment are the same. Watch the lessons in order, then put everything together in the Projects.

Lessons

4 videos
01

Angular Unit Testing Using Karma and Jasmine

The basics of Angular unit testing with Karma and Jasmine, including sample tests for services, components, pipes, and directives.

02

Mastering Angular Unit Testing with Jasmine & Karma

A deeper tutorial on unit testing with Jasmine and Karma, using real examples and tips for code coverage.

03

Angular Production: Build, Test & Deploy a Full Stack Application with Nx

Part I of a series on building an Angular app from scratch and getting it ready for production and deployment using Nx.

04

Angular Tutorial: Build Production and Deploy to a Server

Shows how to build an Angular application for production, then install a web server and deploy the build package to it.