From e0d9753ad83078d36529ff1536cb9f42c6c11065 Mon Sep 17 00:00:00 2001 From: Matt Raible Date: Wed, 5 Jun 2024 21:32:04 -0600 Subject: [PATCH] Migrate unit tests to Angular 18 syntax (#1153) --- .../src/app/pages/account/account.page.spec.ts | 7 ++++--- .../src/app/pages/entities/entities.page.spec.ts | 7 ++++--- .../jwt/src/app/pages/home/home.page.spec.ts | 7 ++++--- .../jwt/src/app/pages/login/login.page.spec.ts | 7 ++++--- .../jwt/src/app/pages/signup/signup.page.spec.ts | 7 ++++--- .../src/app/pages/welcome/welcome.page.spec.ts | 7 ++++--- .../src/app/services/login/login.service.spec.ts | 6 ++++-- .../src/app/services/user/user.service.spec.ts | 6 ++++-- .../oauth2/src/app/app.component.spec.ts | 7 +++++-- .../oauth2/src/app/pages/home/home.page.spec.ts | 7 ++++--- .../src/app/pages/login/login.page.spec.ts | 7 ++++--- .../src/app/pages/welcome/welcome.page.spec.ts | 7 ++++--- .../src/app/services/login/login.service.spec.ts | 6 ++++-- .../pages/entities/_entity-detail.spec.ts.ejs | 14 ++++++-------- .../pages/entities/_entity-update.spec.ts.ejs | 16 ++++++++-------- .../src/app/pages/entities/_entity.spec.ts.ejs | 11 ++++------- 16 files changed, 71 insertions(+), 58 deletions(-) diff --git a/generators/ionic/resources/base/src/app/pages/account/account.page.spec.ts b/generators/ionic/resources/base/src/app/pages/account/account.page.spec.ts index 8d0730d7..08636689 100644 --- a/generators/ionic/resources/base/src/app/pages/account/account.page.spec.ts +++ b/generators/ionic/resources/base/src/app/pages/account/account.page.spec.ts @@ -3,8 +3,8 @@ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; import { AccountPage } from './account.page'; import { TranslateModule } from '@ngx-translate/core'; -import { RouterTestingModule } from '@angular/router/testing'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; describe('AccountPage', () => { let component: AccountPage; @@ -14,7 +14,8 @@ describe('AccountPage', () => { TestBed.configureTestingModule({ declarations: [AccountPage], schemas: [CUSTOM_ELEMENTS_SCHEMA], - imports: [TranslateModule.forRoot(), RouterTestingModule, HttpClientTestingModule], + imports: [TranslateModule.forRoot()], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }).compileComponents(); })); diff --git a/generators/ionic/resources/base/src/app/pages/entities/entities.page.spec.ts b/generators/ionic/resources/base/src/app/pages/entities/entities.page.spec.ts index b619cc73..677c61f1 100644 --- a/generators/ionic/resources/base/src/app/pages/entities/entities.page.spec.ts +++ b/generators/ionic/resources/base/src/app/pages/entities/entities.page.spec.ts @@ -3,8 +3,8 @@ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; import { EntitiesPage } from './entities.page'; import { TranslateModule } from '@ngx-translate/core'; -import { RouterTestingModule } from '@angular/router/testing'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; describe('EntitiesPage', () => { let component: EntitiesPage; @@ -14,7 +14,8 @@ describe('EntitiesPage', () => { TestBed.configureTestingModule({ declarations: [EntitiesPage], schemas: [CUSTOM_ELEMENTS_SCHEMA], - imports: [TranslateModule.forRoot(), RouterTestingModule, HttpClientTestingModule], + imports: [TranslateModule.forRoot()], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }).compileComponents(); })); diff --git a/generators/ionic/resources/jwt/src/app/pages/home/home.page.spec.ts b/generators/ionic/resources/jwt/src/app/pages/home/home.page.spec.ts index c744b73f..c85fca4d 100644 --- a/generators/ionic/resources/jwt/src/app/pages/home/home.page.spec.ts +++ b/generators/ionic/resources/jwt/src/app/pages/home/home.page.spec.ts @@ -3,8 +3,8 @@ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; import { HomePage } from './home.page'; import { TranslateModule } from '@ngx-translate/core'; -import { RouterTestingModule } from '@angular/router/testing'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; describe('HomePage', () => { let component: HomePage; @@ -14,7 +14,8 @@ describe('HomePage', () => { TestBed.configureTestingModule({ declarations: [HomePage], schemas: [CUSTOM_ELEMENTS_SCHEMA], - imports: [TranslateModule.forRoot(), RouterTestingModule, HttpClientTestingModule], + imports: [TranslateModule.forRoot()], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }).compileComponents(); })); diff --git a/generators/ionic/resources/jwt/src/app/pages/login/login.page.spec.ts b/generators/ionic/resources/jwt/src/app/pages/login/login.page.spec.ts index bfba0f2f..7c1ea726 100644 --- a/generators/ionic/resources/jwt/src/app/pages/login/login.page.spec.ts +++ b/generators/ionic/resources/jwt/src/app/pages/login/login.page.spec.ts @@ -3,8 +3,8 @@ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; import { LoginPage } from './login.page'; import { TranslateModule } from '@ngx-translate/core'; -import { RouterTestingModule } from '@angular/router/testing'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; describe('LoginPage', () => { let component: LoginPage; @@ -14,7 +14,8 @@ describe('LoginPage', () => { TestBed.configureTestingModule({ declarations: [LoginPage], schemas: [CUSTOM_ELEMENTS_SCHEMA], - imports: [TranslateModule.forRoot(), RouterTestingModule, HttpClientTestingModule], + imports: [TranslateModule.forRoot()], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }).compileComponents(); })); diff --git a/generators/ionic/resources/jwt/src/app/pages/signup/signup.page.spec.ts b/generators/ionic/resources/jwt/src/app/pages/signup/signup.page.spec.ts index 691ce583..848094b3 100644 --- a/generators/ionic/resources/jwt/src/app/pages/signup/signup.page.spec.ts +++ b/generators/ionic/resources/jwt/src/app/pages/signup/signup.page.spec.ts @@ -3,8 +3,8 @@ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; import { SignupPage } from './signup.page'; import { TranslateModule } from '@ngx-translate/core'; -import { RouterTestingModule } from '@angular/router/testing'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; describe('SignupPage', () => { let component: SignupPage; @@ -14,7 +14,8 @@ describe('SignupPage', () => { TestBed.configureTestingModule({ declarations: [SignupPage], schemas: [CUSTOM_ELEMENTS_SCHEMA], - imports: [TranslateModule.forRoot(), RouterTestingModule, HttpClientTestingModule], + imports: [TranslateModule.forRoot()], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }).compileComponents(); })); diff --git a/generators/ionic/resources/jwt/src/app/pages/welcome/welcome.page.spec.ts b/generators/ionic/resources/jwt/src/app/pages/welcome/welcome.page.spec.ts index 9f396dce..e5c3e8c1 100644 --- a/generators/ionic/resources/jwt/src/app/pages/welcome/welcome.page.spec.ts +++ b/generators/ionic/resources/jwt/src/app/pages/welcome/welcome.page.spec.ts @@ -3,8 +3,8 @@ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; import { WelcomePage } from './welcome.page'; import { TranslateModule } from '@ngx-translate/core'; -import { RouterTestingModule } from '@angular/router/testing'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; describe('WelcomePage', () => { let component: WelcomePage; @@ -14,7 +14,8 @@ describe('WelcomePage', () => { TestBed.configureTestingModule({ declarations: [WelcomePage], schemas: [CUSTOM_ELEMENTS_SCHEMA], - imports: [TranslateModule.forRoot(), RouterTestingModule, HttpClientTestingModule], + imports: [TranslateModule.forRoot()], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }).compileComponents(); })); diff --git a/generators/ionic/resources/jwt/src/app/services/login/login.service.spec.ts b/generators/ionic/resources/jwt/src/app/services/login/login.service.spec.ts index 4a283525..8f950602 100644 --- a/generators/ionic/resources/jwt/src/app/services/login/login.service.spec.ts +++ b/generators/ionic/resources/jwt/src/app/services/login/login.service.spec.ts @@ -1,12 +1,14 @@ import { TestBed } from '@angular/core/testing'; import { LoginService } from './login.service'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TranslateModule } from '@ngx-translate/core'; describe('LoginService', () => { beforeEach(() => TestBed.configureTestingModule({ - imports: [HttpClientTestingModule, TranslateModule.forRoot()], + imports: [TranslateModule.forRoot()], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }), ); diff --git a/generators/ionic/resources/jwt/src/app/services/user/user.service.spec.ts b/generators/ionic/resources/jwt/src/app/services/user/user.service.spec.ts index d1328bd6..8668ab2a 100644 --- a/generators/ionic/resources/jwt/src/app/services/user/user.service.spec.ts +++ b/generators/ionic/resources/jwt/src/app/services/user/user.service.spec.ts @@ -1,12 +1,14 @@ import { TestBed } from '@angular/core/testing'; import { UserService } from './user.service'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TranslateModule } from '@ngx-translate/core'; describe('UserService', () => { beforeEach(() => TestBed.configureTestingModule({ - imports: [HttpClientTestingModule, TranslateModule.forRoot()], + imports: [TranslateModule.forRoot()], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }), ); diff --git a/generators/ionic/resources/oauth2/src/app/app.component.spec.ts b/generators/ionic/resources/oauth2/src/app/app.component.spec.ts index 73786ad4..d3dfa4ad 100644 --- a/generators/ionic/resources/oauth2/src/app/app.component.spec.ts +++ b/generators/ionic/resources/oauth2/src/app/app.component.spec.ts @@ -1,6 +1,7 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { TestBed, fakeAsync, tick } from '@angular/core/testing'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; import { Platform } from '@ionic/angular'; import { IonicStorageModule } from '@ionic/storage-angular'; @@ -46,11 +47,13 @@ describe('AppComponent', () => { TestBed.configureTestingModule({ declarations: [AppComponent], - imports: [TranslateModule.forRoot(), HttpClientTestingModule, IonicStorageModule.forRoot()], schemas: [CUSTOM_ELEMENTS_SCHEMA], + imports: [TranslateModule.forRoot(), IonicStorageModule.forRoot()], providers: [ { provide: Platform, useValue: platformSpy }, { provide: AuthService, useValue: authServiceSpy }, + provideHttpClient(withInterceptorsFromDi()), + provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/generators/ionic/resources/oauth2/src/app/pages/home/home.page.spec.ts b/generators/ionic/resources/oauth2/src/app/pages/home/home.page.spec.ts index f5e0408c..125f0fb1 100644 --- a/generators/ionic/resources/oauth2/src/app/pages/home/home.page.spec.ts +++ b/generators/ionic/resources/oauth2/src/app/pages/home/home.page.spec.ts @@ -1,9 +1,9 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { IonicStorageModule } from '@ionic/storage-angular'; import { TranslateModule } from '@ngx-translate/core'; -import { RouterTestingModule } from '@angular/router/testing'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; import { HomePage } from './home.page'; import { AuthModule } from '../../auth/auth.module'; @@ -15,7 +15,8 @@ describe('HomePage', () => { TestBed.configureTestingModule({ declarations: [HomePage], schemas: [CUSTOM_ELEMENTS_SCHEMA], - imports: [TranslateModule.forRoot(), RouterTestingModule, HttpClientTestingModule, IonicStorageModule.forRoot(), AuthModule], + imports: [TranslateModule.forRoot(), IonicStorageModule.forRoot(), AuthModule], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }).compileComponents(); })); diff --git a/generators/ionic/resources/oauth2/src/app/pages/login/login.page.spec.ts b/generators/ionic/resources/oauth2/src/app/pages/login/login.page.spec.ts index 8c9d4e1a..c3f2c19e 100644 --- a/generators/ionic/resources/oauth2/src/app/pages/login/login.page.spec.ts +++ b/generators/ionic/resources/oauth2/src/app/pages/login/login.page.spec.ts @@ -2,8 +2,8 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { IonicStorageModule } from '@ionic/storage-angular'; import { TranslateModule } from '@ngx-translate/core'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { RouterTestingModule } from '@angular/router/testing'; +import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; import { LoginPage } from './login.page'; import { AuthModule } from '../../auth/auth.module'; @@ -15,7 +15,8 @@ describe('LoginPage', () => { TestBed.configureTestingModule({ declarations: [LoginPage], schemas: [CUSTOM_ELEMENTS_SCHEMA], - imports: [TranslateModule.forRoot(), RouterTestingModule, HttpClientTestingModule, IonicStorageModule.forRoot(), AuthModule], + imports: [TranslateModule.forRoot(), IonicStorageModule.forRoot(), AuthModule], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }).compileComponents(); })); diff --git a/generators/ionic/resources/oauth2/src/app/pages/welcome/welcome.page.spec.ts b/generators/ionic/resources/oauth2/src/app/pages/welcome/welcome.page.spec.ts index f075a053..7cc9cf5d 100644 --- a/generators/ionic/resources/oauth2/src/app/pages/welcome/welcome.page.spec.ts +++ b/generators/ionic/resources/oauth2/src/app/pages/welcome/welcome.page.spec.ts @@ -2,8 +2,8 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; import { IonicStorageModule } from '@ionic/storage-angular'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { RouterTestingModule } from '@angular/router/testing'; +import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; import { WelcomePage } from './welcome.page'; import { AuthModule } from '../../auth/auth.module'; @@ -15,7 +15,8 @@ describe('WelcomePage', () => { TestBed.configureTestingModule({ declarations: [WelcomePage], schemas: [CUSTOM_ELEMENTS_SCHEMA], - imports: [TranslateModule.forRoot(), HttpClientTestingModule, IonicStorageModule.forRoot(), RouterTestingModule, AuthModule], + imports: [TranslateModule.forRoot(), IonicStorageModule.forRoot(), AuthModule], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }).compileComponents(); })); diff --git a/generators/ionic/resources/oauth2/src/app/services/login/login.service.spec.ts b/generators/ionic/resources/oauth2/src/app/services/login/login.service.spec.ts index f8e5b8f0..0ea59d8a 100644 --- a/generators/ionic/resources/oauth2/src/app/services/login/login.service.spec.ts +++ b/generators/ionic/resources/oauth2/src/app/services/login/login.service.spec.ts @@ -1,6 +1,7 @@ import { IonicStorageModule } from '@ionic/storage-angular'; import { TranslateModule } from '@ngx-translate/core'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { LoginService } from './login.service'; import { AuthModule } from '../../auth/auth.module'; @@ -8,7 +9,8 @@ import { AuthModule } from '../../auth/auth.module'; describe('LoginService', () => { beforeEach(() => TestBed.configureTestingModule({ - imports: [HttpClientTestingModule, TranslateModule.forRoot(), IonicStorageModule.forRoot(), AuthModule], + imports: [TranslateModule.forRoot(), IonicStorageModule.forRoot(), AuthModule], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }), ); diff --git a/generators/ionic/templates/src/app/pages/entities/_entity-detail.spec.ts.ejs b/generators/ionic/templates/src/app/pages/entities/_entity-detail.spec.ts.ejs index 59e3bcf8..0379bbee 100644 --- a/generators/ionic/templates/src/app/pages/entities/_entity-detail.spec.ts.ejs +++ b/generators/ionic/templates/src/app/pages/entities/_entity-detail.spec.ts.ejs @@ -19,8 +19,8 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { RouterTestingModule } from '@angular/router/testing'; +import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ActivatedRoute } from '@angular/router'; import { of } from 'rxjs'; import { <%= entityAngularName %>DetailPage } from './<%= entityFileName %>-detail'; @@ -39,13 +39,11 @@ describe('<%= entityAngularName %>DetailPage', () => { TestBed.configureTestingModule({ declarations: [<%= entityAngularName %>DetailPage], schemas: [CUSTOM_ELEMENTS_SCHEMA], - imports: [ - TranslateModule.forRoot(), - HttpClientTestingModule, - RouterTestingModule, - ], + imports: [TranslateModule.forRoot()], providers: [ - { provide: ActivatedRoute, useValue: activatedRouteMock } + { provide: ActivatedRoute, useValue: activatedRouteMock }, + provideHttpClient(withInterceptorsFromDi()), + provideHttpClientTesting(), ] }).compileComponents(); })); diff --git a/generators/ionic/templates/src/app/pages/entities/_entity-update.spec.ts.ejs b/generators/ionic/templates/src/app/pages/entities/_entity-update.spec.ts.ejs index 8e3a8b56..c8d16bc1 100644 --- a/generators/ionic/templates/src/app/pages/entities/_entity-update.spec.ts.ejs +++ b/generators/ionic/templates/src/app/pages/entities/_entity-update.spec.ts.ejs @@ -19,8 +19,8 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { RouterTestingModule } from '@angular/router/testing'; +import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ActivatedRoute } from '@angular/router'; import { of } from 'rxjs'; import { IonicModule } from '@ionic/angular'; @@ -49,13 +49,13 @@ const activatedRouteMock = ({ data: of({ data: entityMock }) } as any) as Activa schemas: [CUSTOM_ELEMENTS_SCHEMA], imports: [ TranslateModule.forRoot(), - HttpClientTestingModule, - RouterTestingModule, FormsModule, ReactiveFormsModule, IonicModule ], - providers: [ - { provide: ActivatedRoute, useValue: activatedRouteMock }, - { provide: UserService, useValue: userServiceMock }, - ] + providers: [ + { provide: ActivatedRoute, useValue: activatedRouteMock }, + { provide: UserService, useValue: userServiceMock }, + provideHttpClient(withInterceptorsFromDi()), + provideHttpClientTesting(), + ] }).compileComponents(); })); diff --git a/generators/ionic/templates/src/app/pages/entities/_entity.spec.ts.ejs b/generators/ionic/templates/src/app/pages/entities/_entity.spec.ts.ejs index 9f100fa7..a04b5728 100644 --- a/generators/ionic/templates/src/app/pages/entities/_entity.spec.ts.ejs +++ b/generators/ionic/templates/src/app/pages/entities/_entity.spec.ts.ejs @@ -19,8 +19,8 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { RouterTestingModule } from '@angular/router/testing'; +import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; import { <%= entityAngularName %>Page } from './<%= entityFileName %>'; describe('<%= entityAngularName %>Page', () => { @@ -31,11 +31,8 @@ describe('<%= entityAngularName %>Page', () => { TestBed.configureTestingModule({ declarations: [<%= entityAngularName %>Page], schemas: [CUSTOM_ELEMENTS_SCHEMA], - imports: [ - TranslateModule.forRoot(), - HttpClientTestingModule, - RouterTestingModule, - ] + imports: [TranslateModule.forRoot()], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }).compileComponents(); }));