I've created a testing (spec) file for a component I'm testing. But when I run the test, it gives me an error saying
Cannot read property 'subscribe' of undefined
TypeError: Cannot read property 'subscribe' of undefined
at ComponentUndertest.ngOnInit
which is obvious because I have subscribed to something in my ngOnInit() method, but can I ignore the subscription during the test? Or can I fake a subscription during testing? I have googled a lot about this issue but couldn't find anything related with angular2 testing.