-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Accelerating Angular Development with Ivy
By :

For many different types of tests, Angular's TestBed
API is both necessary and useful. Ivy introduces a strongly typed API for resolving dependencies through the Angular testing module injector, which can be configured using the static TestBed.configureTestingModule
method. In this section, we will explore stronger typing in Angular tests.
Let's also look at an integrated component test for an Angular component using a custom Angular Material SVG icon. This can be done using the FakeMatIconRegistry
service that was introduced with Angular Ivy.
TestBed.get
always returns a value of the any
type. This static deprecated method has not been deprecated as of Angular version 12, but it could be removed in any major version following that. Its replacement is the type-safe TestBed.inject
static method.
Let's look at a couple of simple examples to see the immediate...