Angular Unit testing with Jasmine Training

Course duration

Course Benefits

  • Learn how to use both synchronous and asynchronous tests with Angular components, pipes and services.
  • Learn to write tests that include Angular routing and incorporate spies and mocks.

Course Outline

  1. Unit testing in Jasmine
    1. Software Testing
    2. Types of tests
    3. Test Pyramid
    4. Unit Tests
    5. Jasmine, Karma and Angular
    6. Jasmine
    7. Karma
    8. Basic Terminology
    9. Test Suite
    10. Spec
    11. Assertion
    12. Matchers
    13. Setup and Teardown
    14. A Test Suite
    15. Auto-Generated Angular Test Suites
    16. Run a Test
    17. Summary
  2. Jasmine Configuration
    1. Setup and Teardown
    2. Setup/Teardown Example
    3. Order of Execution
    4. Nested Test Suites
    5. Nested Test Suites Order of Execution
    6. Nested Setup/Teardown Order of Execution
    7. Custom Matchers
    8. Interface
    9. Matcher Factory
    10. Use the Matcher
    11. Run the Tests
    12. Disabling Suites and Specs
    13. The this Keyword
    14. Summary
  3. Testing - Components, Pipes and Services
    1. Testing Components
    2. Testing the Class Only
    3. Example Component
    4. Test Component Class
    5. Test Component Class Example
    6. Test Component
    7. Test Component Example
    8. TypeScript async/await
    9. Change Detection
    10. DOM Element(s)
    11. Testing Pipes
    12. Pipe Class Example
    13. Pipe Spec Example
    14. Testing Services
    15. Service Class Example
    16. Service Spec Example
    17. Expecting an Error
    18. Summary
  4. Testing – DOM, Routing and Code Coverage
    1. Testing in Angular
    2. Components
    3. Testing the DOM
    4. DOM Testing vs End-to-End Testing
    5. TestBed
    6. TestBed Use Cases
    7. Using TestBed
    8. ComponentFixture
    9. Get the Component and DOM Element
    10. Selecting DOM Elements with NativeElement
    11. Selecting DOM Elements with DebugElement
    12. Selection Examples
    13. Accessing Text
    14. Button Clicks
    15. Routing
    16. Routing Test Setup
    17. Routing Spec
    18. Code Coverage
    19. Detailed Coverage Summary
    20. Details
    21. Summary
  5. Integration Testing
    1. Integration Testing
    2. Spies
    3. Service Class Example
    4. Spec
    5. Using a Spy to Return a Fixed Value
    6. Using a Spy to Return a Dynamic Value
    7. Injection
    8. Injection Example
    9. Injection in a Test Suite
    10. Mocks
    11. Summary

Class Materials

Each student will receive a comprehensive set of materials, including course notes and all the class examples.

Class Prerequisites

Experience in the following is required for this Angular class:

  • Experience with Angular
Prerequisite Courses

Courses that can help you meet these prerequisites:

Since its founding in 1995, InterSource has been providing high quality and highly customized training solutions to clients worldwide. With over 500 course titles constantly updated and numerous course customization and creation possibilities, we have the capability to meet your I.T. training needs.
Instructor-led courses are offered via a live Web connection, at client sites throughout Europe, and at our Geneva Training Center.