Test your Angular web application using Jasmine and Karma

Offered By
Coursera Project Network
In this Guided Project, you will:

Understand how the Jasmine test framework apply unit testing to Angular apps

Understand how Karma spawns test instances

Understand how to write unit tests in Jasmine

Clock2 hours
IntermediateIntermediate
CloudNo download needed
VideoSplit-screen video
Comment DotsEnglish
LaptopDesktop only

In this 1-hour long project-based course, you will learn how to generate a new Angular project, create components and write unit tests in the spec file. You will learn how to bootstrap your tests, and will test the presence of text and the action of clicking a button. You will test the presence of HTML attributes, and the passage of data from a parent component to a child component. Note: This course works best for learners who are based in the North America region. We’re currently working on providing the same experience in other regions.

Skills you will develop

KarmaTypescriptJasmine testingUnit TestingAngular development

Learn step-by-step

In a video that plays in a split-screen with your work area, your instructor will walk you through these steps:

  1. Create a new angular project using Angular CLI, and start testing

  2. Understand how Jasmine, Karma, the spec file and TestBed work

  3. Test the main app component for displaying strings and clicking buttons

  4. Bootstrap your TestBed configuration for your tests using beforeEach

  5. Test the presence of a HTML element

  6. Test passing data between components

How Guided Projects work

Your workspace is a cloud desktop right in your browser, no download required

In a split-screen video, your instructor guides you step-by-step

Frequently asked questions

Frequently Asked Questions

More questions? Visit the Learner Help Center.