import { TestBed } from '@angular/core/testing' ; import { RouterTestingModule } from '@angular/router/testing' ; import { AppComponent } from './app.component' ; import { HeaderComponent } from './header/header.component' ; import { LoginComponent } from './login/login.component' ; import { SharedModule } from './shared/shared.module' ; import { UserDetailsComponent } from './user-details/user-details.component' ; describe ( 'AppComponent' , ( ) => { beforeEach ( async ( ) => { await TestBed . configureTestingModule ( { imports : [ RouterTestingModule , SharedModule ] , declarations : [ AppComponent , LoginComponent , HeaderComponent , UserDetailsComponent ] , } ) . compileComponents ( ) ; } ) ; it ( 'should create the app' , ( ) => { const fixture = TestBed . createComponent ( AppComponent ) ; const app = fixture . componentInstance ; expect ( app ) . toBeTruthy ( ) ; } ) ; it ( `should have as title 'angular-app'` , ( ) => { const fixture = TestBed . createComponent ( AppComponent ) ; const app = fixture . componentInstance ; expect ( app . title ) . toEqual ( 'angular-app' ) ; } ) ; } ) ;