title: Angular unit testing TypeError: Cannot read property 'subscribe' of undefined
body: <p>I'm creating starter kit template with auth and a example with CRUD (<a href="https://github.com/fransyozef/basic-login-angular" rel="nofollow noreferrer">https://github.com/fransyozef/basic-login-angular</a>)</p>
  
  <p>Now I'm new with unit testing and i'm trying to get atleast get the testing running that the components are created. But I'm getting stuck with </p>
  
  <pre><code>TypeError: Cannot read property 'subscribe' of undefined
  </code></pre>
  
  <p>I think the error comes from</p>
  
  <pre><code>  resolveRoute() {
      this.route.params.subscribe(params =&gt; {
        if (params['id']) {
          this.id = +params['id'];
          this.getItem();
        } else {
          this.handleItemNotFound();
        }
       });
    }
  </code></pre>
  
  <p>in the file <a href="https://github.com/fransyozef/basic-login-angular/blob/master/src/app/items/item-edit/item-edit.component.ts" rel="nofollow noreferrer">https://github.com/fransyozef/basic-login-angular/blob/master/src/app/items/item-edit/item-edit.component.ts</a></p>
  
  <p>Right now I have the testfile :
  <a href="https://github.com/fransyozef/basic-login-angular/blob/master/src/app/items/item-edit/item-edit.component.spec.ts" rel="nofollow noreferrer">https://github.com/fransyozef/basic-login-angular/blob/master/src/app/items/item-edit/item-edit.component.spec.ts</a></p>
  
  <p>Can somebody give me a hand with this?</p>