im going nuts is someon…

1 minute read

im going nuts, is someone here available for some quick questions regarding jest? Please, thanks


I’m out and about but will answer if I can

Jay, thanks. I’m trying to mock this and in my head I can’t properly comprehend how testing works… its getting frustrating. Its just the basic entry for Ionic and I just can’t understand what im doing wrong or missing. I’ve read but idk, I guess my brain is not on par :S

heres what I’ve done using ngneat’s spectator, which still.. I have no grasp as to how it fully works

What is the actual error that is thrown?

that the platformSpy.ready is not being called

so basically the second IT block is not working

Why are you doing the stuff in the inner beforeeach?

And what does your app module look like

module? hold on

``import { NgModule } from ‘@angular/core’; import { BrowserModule } from ‘@angular/platform-browser’; import { RouteReuseStrategy } from ‘@angular/router’;

import { IonicModule, IonicRouteStrategy } from ‘@ionic/angular’; import { SplashScreen } from ‘@ionic-native/splash-screen/ngx’; import { StatusBar } from ‘@ionic-native/status-bar/ngx’;

import { AppComponent } from ‘./app.component’; import { AppRoutingModule } from ‘./app-routing.module’;

@NgModule({ declarations: [AppComponent], entryComponents: [], imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule], providers: [ StatusBar, SplashScreen, { provide: RouteReuseStrategy, useClass: IonicRouteStrategy } ], bootstrap: [AppComponent] }) export class AppModule {}```

this is basically the hello-world of a newly created ionic app, so its just that.

Everything there was generated by ionic?


Even the array of providers?


Oh I know why

You are doing a mock implementation of the initializeapp function which means it’s never called

And thus the platform ready is never called

I’ve tried soo much haha and for example, without that line, its still not being called.