import { TestBed , waitForAsync , ComponentFixture } from '@angular/core/testing' ; import { AppComponent } from './app.component' ; import { RouterTestingModule } from '@angular/router/testing' ; import { ServiceWorkerModule } from '@angular/service-worker' ; describe ( 'AppComponent' , ( ) => { let component ; let fixture ; beforeEach ( waitForAsync ( async ( ) => { await TestBed . configureTestingModule ( { imports : [ RouterTestingModule , ServiceWorkerModule . register ( '' , { enabled : false } ) ] , declarations : [ AppComponent ] , } ) . compileComponents ( ) ; fixture = TestBed . createComponent ( AppComponent ) ; component = fixture . debugElement . componentInstance ; } ) ) ; it ( 'should create the webapp' , async ( ( ) => { expect ( component ) . toBeTruthy ( ) ; } ) ) ; it ( `should have as charset 'UTF-8'` , async ( ( ) => { expect ( component . meta . getTag ( 'charset' ) . getAttribute ( 'charset' ) ) . toBe ( 'UTF-8' ) ; } ) ) ; } ) ;