651-905-3729 Microsoft Silver Learning Partner EC Counsel Reseller compTIA Authorized Partner

Angular Unit testing with Jasmine Training

2 Days

Description

Unit tests are the base platform of programming tests, the piece you should build before you create other kinds of tests or even your core code.  In this two day Jasmine course, students will gain a solid understanding of Unit Testing fundamentals and how to effectively apply them in Jasmine. Examples and hands-on labs, include noth core JavaScript and TypeScript/Angular. Get ready to master the leading unit testing framework!   

Objectives

  • Students will learn how to use both synchronous and asynchronous tests with Angular components, pipes and services.
  • Students will also have opportunities to write tests that include Angular routing and incorporate spies and mocks.

No Upcoming Public Classes

There are currently no public events available for this course. However, you can submit a request for a new date and we will try our best to get you into a Angular Unit testing with Jasmine Training class.

Private Training Available
No date scheduled, don’t see a date that works for you or looking for a private training event, please call 651-905-3729 or submit a request for further information here.
request a private session or new date

Course Overview

Chapter 1. Unit testing in Jasmine

  • Software Testing
  • Types of tests
  • Test Pyramid
  • Unit Tests
  • Jasmine, Karma and Angular
  • Jasmine
  • Karma
  • Basic Terminology
  • Test Suite
  • Spec
  • Assertion
  • Matchers
  • Setup and Teardown
  • A Test Suite
  • Auto-Generated Angular Test Suites
  • Run a Test
  • Summary

Chapter 2. Jasmine Configuration

  • Setup and Teardown
  • Setup/Teardown Example
  • Order of Execution
  • Nested Test Suites
  • Nested Test Suites Order of Execution
  • Nested Setup/Teardown Order of Execution
  • Custom Matchers
  • Interface
  • Matcher Factory
  • Use the Matcher
  • Run the Tests
  • Disabling Suites and Specs
  • The this Keyword
  • Summary

Chapter 3. Testing - Components, Pipes and Services

  • Testing Components
  • Testing the Class Only
  • Example Component
  • Test Component Class
  • Test Component Class Example
  • Test Component
  • Test Component Example
  • TypeScript async/await
  • Change Detection
  • DOM Element(s)
  • Testing Pipes
  • Pipe Class Example
  • Pipe Spec Example
  • Testing Services
  • Service Class Example
  • Service Spec Example
  • Expecting an Error
  • Summary

Chapter 4. Testing – DOM, Routing and Code Coverage

  • Testing in Angular
  • Components
  • Testing the DOM
  • DOM Testing vs End-to-End Testing
  • TestBed
  • TestBed Use Cases
  • Using TestBed
  • ComponentFixture
  • Get the Component and DOM Element
  • Selecting DOM Elements with NativeElement
  • Selecting DOM Elements with DebugElement
  • Selection Examples
  • Accessing Text
  • Button Clicks
  • Routing
  • Routing Test Setup
  • Routing Spec
  • Code Coverage
  • Detailed Coverage Summary
  • Details
  • Summary

Chapter 5. Integration Testing

  • Integration Testing
  • Spies
  • Service Class Example
  • Spec
  • Using a Spy to Return a Fixed Value
  • Using a Spy to Return a Dynamic Value
  • Injection
  • Injection Example
  • Injection in a Test Suite
  • Mocks
  • Summary

Lab Exercises

  • Lab 1. Run a Simple Test
  • Lab 2. Running and Debugging Tests in Karma
  • Lab 3. Test a Pipe and a Service
  • Lab 4. Code Coverage
  • Lab 5. Spies
  • Lab 6. Build an Asynchronous Test

No Upcoming Public Classes

There are currently no public events available for this course. However, you can submit a request for a new date and we will try our best to get you into a Angular Unit testing with Jasmine Training class.

Private Training Available
No date scheduled, don’t see a date that works for you or looking for a private training event, please call 651-905-3729 or submit a request for further information here.
request a private session or new date