-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
Hey I'm working on getting tests up and running for a service that I wrote that uses the App in the constructor.
constructor(public appCtrl: App) {
this.appCtrl.viewDidLeave.subscribe(view => {
this.updateHistory(view);
});
}
Here's the constructor for the class that I'm testing and here is my test:
describe('tab service', () => {
let tabSvc: TabService;
let app: App;
beforeEach(() => {
app = AppMock.instance();
TestBed.configureTestingModule({
providers: [
TabService,
]
});
tabSvc = new TabService(app);
});
it('should have a updatehistoy method', () => {
expect(tabSvc.updateHistory).toBe(true);
});
});
Every time I run the test it seems like it gets to the constructor of my service then it fails with this error:
TypeError: this.appCtrl.viewDidLeave.subscribe is not a function
Any ideas on what's going on here? I looked at the code and it looks like viewDidLeave is available on your AppMock and should always be an Observable. Any idea why I can't subscribe to it?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels