I use viewCtrl.willEnter
to generate a Observable that I call .subscribe
on in a Component
. Currently, the tests are throwing a viewCtrl.willEnter.subscribe
is not a valid function error. This is because in Ionic 2, I have to mock the viewController, and I have not successfully done so for this particular method.
This is what I got so far.
public willEnter(): Observable<boolean> {
let observable = Observable.create(function (observer) {
observer.onNext(true);
observer.onCompleted();
});
return observable
};