import { TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { AuthService } from '@auth0/auth0-angular'; import { AppComponent } from './app.component'; describe('AppComponent', () => { let authServiceSpy: unknown; beforeEach(() => { authServiceSpy = jasmine.createSpyObj('AuthService', ['loginWithRedirect']); TestBed.configureTestingModule({ imports: [RouterTestingModule], declarations: [], providers: [ { provide: AuthService, useValue: authServiceSpy, }, ], }).compileComponents(); }); it('should create the app', () => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.debugElement.componentInstance; expect(app).toBeTruthy(); }); });