8351  Reviews star_rate star_rate star_rate star_rate star_half

Angular Unit testing with Jasmine

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...

Read More
$1,600 USD
Duration 2 days
Course Code WA3140
Available Formats Classroom

Overview

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!

Skills Gained

  • 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.

Course Details

Outline

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

Schedule

FAQ

Does the course schedule include a Lunchbreak?

Classes typically include a 1-hour lunch break around midday. However, the exact break times and duration can vary depending on the specific class. Your instructor will provide detailed information at the start of the course.

What languages are used to deliver training?

Most courses are conducted in English, unless otherwise specified. Some courses will have the word "FRENCH" marked in red beside the scheduled date(s) indicating the language of instruction.

What does GTR stand for?

GTR stands for Guaranteed to Run; if you see a course with this status, it means this event is confirmed to run. View our GTR page to see our full list of Guaranteed to Run courses.

Does Ascendient Learning deliver group training?

Yes, we provide training for groups, individuals and private on sites. View our group training page for more information.

What does vendor-authorized training mean?

As a vendor-authorized training partner, we offer a curriculum that our partners have vetted. We use the same course materials and facilitate the same labs as our vendor-delivered training. These courses are considered the gold standard and, as such, are priced accordingly.

Is the training too basic, or will you go deep into technology?

It depends on your requirements, your role in your company, and your depth of knowledge. The good news about many of our learning paths, you can start from the fundamentals to highly specialized training.

How up-to-date are your courses and support materials?

We continuously work with our vendors to evaluate and refresh course material to reflect the latest training courses and best practices.

Are your instructors seasoned trainers who have deep knowledge of the training topic?

Ascendient Learning instructors have an average of 27 years of practical IT experience and have also served as consultants for an average of 15 years. To stay current, instructors spend at least 25 percent of their time learning new, emerging technologies and courses.

Do you provide hands-on training and exercises in an actual lab environment?

Lab access is dependent on the vendor and the type of training you sign up for. However, many of our top vendors will provide lab access to students to test and practice. The course description will specify lab access.

Will you customize the training for our company’s specific needs and goals?

We will work with you to identify training needs and areas of growth.  We offer a variety of training methods, such as private group training, on-site of your choice, and virtually. We provide courses and certifications that are aligned with your business goals.

How do I get started with certification?

Getting started on a certification pathway depends on your goals and the vendor you choose to get certified in. Many vendors offer entry-level IT certification to advanced IT certification that can boost your career. To get access to certification vouchers and discounts, please contact info@ascendientlearning.com.

Will I get access to content after I complete a course?

You will get access to the PDF of course books and guides, but access to the recording and slides will depend on the vendor and type of training you receive.

How do I request a W9 for Ascendient Learning?

View our filing status and how to request a W9.

Reviews

Instructor, Training material & span of the training is neatly planned.

I registered a day before class and am happy that I received all the materials and links in time for the class. Thanks.

The class and material is good. I think some of the software needs to be updated.

Brandon was a great instructor. The virtual course materials and labs provided were very informative.

The tool provided to practice the course teachings is very functional and easy to use.