title: unit test a variable declaration inside ngOnInit()
body: <p>I'm trying to skill up in TDD, and I'm doing again every tutorials I could followed in Angular. 
  But this time trying to unit tests them with 100% code coverage.</p>
  
  <p>I've a stupid question, that I can't find the answer in <a href="https://angular.io/guide/testing" rel="nofollow noreferrer">the documentation</a>.
  Can't find questions that are that simple in Stackoverflow neither. </p>
  
  <pre><code>import { Component, OnInit, OnDestroy } from '@angular/core';
  import { Observable, interval, Subscription } from 'rxjs/';
  
  @Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.scss']
  })
  export class AppComponent implements OnInit, OnDestroy {
  
    secondes: number;
    counterSubscritpion: Subscription;
  
    ngOnInit() {
      const counter = interval(1000);
      const dummy = 'foo';
  
      this.counterSubscritpion = counter.subscribe(
        (value) =&gt; {
          this.secondes = value;
      });
    }
  
    ngOnDestroy() {
      this.counterSubscritpion.unsubscribe();
    }
  </code></pre>
  
  <p>My template is of course very simple : </p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;p&gt; nothing should appear here : {{dummy}} &lt;/p&gt;
  &lt;p&gt; whereas here should be {{secondes}} secondes &lt;/p&gt;
  </code></pre>
  
  <p>So reading the documentation will help me testing <code>secondes</code> and <code>counterSubscritpion</code>...</p>
  
  <p><strong>But how do I test that <code>counter</code> and <code>dummy</code> have been declared as well as their values ?</strong>
  because Karma's test coverage report tells me that I should test the `interval(1000) calls</p>
  
  <p>So far i'm stuck with this : </p>
  
  <pre><code>  let fixture: ComponentFixture&lt;AppComponent&gt;;
    let routerOutlet: any;
  
    beforeEach(() =&gt; {
      TestBed.configureTestingModule({
        declarations: [AppComponent]
      });
      fixture = TestBed.createComponent(AppComponent);
    });
  
    it ('should declare dummy variable', () =&gt; {
      const appComp = new AppComponent();
      appComp.ngOnInit();
      // and so what ???
    });
  </code></pre>