import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core' ; import { TestBed , waitForAsync } from '@angular/core/testing' ; import { ModalController , Platform } from '@ionic/angular' ; import { SplashScreen } from '@ionic-native/splash-screen/ngx' ; import { StatusBar } from '@ionic-native/status-bar/ngx' ; import { RouterTestingModule } from '@angular/router/testing' ; import { AppComponent } from './app.component' ; import { TranslateModule } from '@ngx-translate/core' ; import { Storage } from '@ionic/storage' ; import { InAppBrowser } from '@ionic-native/in-app-browser/ngx' ; import { File } from '@ionic-native/file/ngx' ; import { AppMinimize } from '@ionic-native/app-minimize/ngx' ; import { Keyboard } from '@ionic-native/keyboard/ngx' ; import { ThreeDeeTouch } from '@ionic-native/three-dee-touch/ngx' ; import { Globalization } from '@ionic-native/globalization/ngx' ; describe ( 'AppComponent' , ( ) => { let statusBarSpy , splashScreenSpy , platformReadySpy , platformSpy ; beforeEach ( waitForAsync ( ( ) => { statusBarSpy = jasmine . createSpyObj ( 'StatusBar' , [ 'styleDefault' ] ) ; splashScreenSpy = jasmine . createSpyObj ( 'SplashScreen' , [ 'hide' ] ) ; platformReadySpy = Promise . resolve ( undefined ) ; platformSpy = jasmine . createSpyObj ( 'Platform' , { ready : platformReadySpy } ) ; TestBed . configureTestingModule ( { declarations : [ AppComponent ] , schemas : [ CUSTOM_ELEMENTS_SCHEMA ] , providers : [ { provide : StatusBar , useValue : statusBarSpy } , { provide : SplashScreen , useValue : splashScreenSpy } , { provide : Platform , useValue : platformSpy } , { provide : Storage } , { provide : InAppBrowser } , { provide : File } , { provide : AppMinimize } , { provide : Keyboard } , { provide : ThreeDeeTouch } , { provide : ModalController } , { provide : Globalization } , ] , imports : [ RouterTestingModule . withRoutes ( [ ] ) , TranslateModule . forRoot ( ) ] , } ) . compileComponents ( ) ; } ) ) ; it ( 'should create the app' , async ( ) => { const fixture = TestBed . createComponent ( AppComponent ) ; const app = fixture . debugElement . componentInstance ; expect ( app ) . toBeTruthy ( ) ; } ) ; } ) ;