I'm trying to create a spec.ts for my application. Sadly this is using the LoadingController from ionic-angular. Now when I'm trying to configure the module, I will need to provide it with the LoadingController (since it's in the constructor of the module).
The problem I'm currently running into is that the LoadingController wants to be provided with a App object/instance. (_app: App params)
I was desperate so I asked Ionic themselves. github #8539
But they closed my question because it was a question and not an issue, although I'm having issues realizing it which they haven't responded to. It would be a shame if this is impossible/no one knows how, since it's a pretty cool feature and it affects not just the LoadingController, f.e. the AlertController and ToastController are affected by this as well.
My testbed configuration atm:
TestBed.configureTestingModule({
declarations: [EventsPage],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
providers: [
{provide: APICaller, useValue: mockAPICaller},
{provide: NavController, useValue: mockNavController },
{provide: LoadingController, useValue: ???????}, //it seems like everything I try to enter here fails.
],
imports: [FormsModule]
});
And the EventsPage constructor:
constructor(public apiCaller: APICaller, public navCtrl: NavController,
public loadingCtrl: LoadingController){}
Aucun commentaire:
Enregistrer un commentaire