title: Karma: Cannot read property * of undefined
body: <p>I have a service which I would like to test:</p>
  
  <pre><code>@Injectable()
  export class AuthenticationService {
    initialAuthStatus = this.authenticationStatus.first();
  
    constructor(private adalService: AdalService,
                private settingsProvider: SettingsProvider) { }
  
  
    public get authenticationStatus(): any {
      return this.adalService.userInfo.authenticationStatus;
    }
  }
  </code></pre>
  
  <p>And a test for the service:</p>
  
  <pre><code>describe('AuthenticationService', () =&gt; {
      let mockAdalService: any;
      let adalService: any;
      let service: any;
      let mockSettingsProvider: any;
      beforeEach(() =&gt; {
          TestBed.configureTestingModule({
            providers: [
              AuthenticationService, 
              AdalService,
              { provide: SettingsProvider, useClass: MockSettingsProvider },
              { provide: AdalService, useClass: MockAdalService }
            ]
          });
  
          mockAdalService = new MockAdalService();
          adalService = new AdalService();
          mockSettingsProvider = new MockSettingsProvider();
      });
  
      it('should be created', inject([AuthenticationService], (service: AuthenticationService) =&gt; {
          expect(service).toBeTruthy();
      }));
  });
  </code></pre>
  
  <p>However, the test fails with the following error message:</p>
  
  <pre><code>AuthenticationService should be created
  TypeError: Cannot read property 'authenticationStatus' of undefined
  </code></pre>
  
  <p>It has something to do with the getter of authentication status, but I can't figure out exactly why it fails.</p>
  
  <p>Any help is greatly appreciated :)</p>