title: angular 2 component with ngrx - errors when run unit-testing
body: <p>I'm working on angular 2 project, using ngrx (for Redux logic) and rxjs (for observable).</p>
  
  <p>Now I try to testing the project by running the auto-created .spec.ts files.</p>
  
  <p>Some of the testings are fail, all of them are testing of components which use Store (from ngrx). 
  Here is one of them:</p>
  
  <pre><code>import { async, ComponentFixture, TestBed } from '@angular/core/testing';
  import { By } from '@angular/platform-browser';
  import { DebugElement } from '@angular/core';
  
  import { MyComponent } from './overlay-menu-item.component';
  
  describe('MyComponent', () =&gt; {
  let component: MyComponent;
  let fixture: ComponentFixture&lt;MyComponent&gt;;
  
  beforeEach(async(() =&gt; {
    TestBed.configureTestingModule({
      declarations: [ MyComponent ],
    })
    .compileComponents();
  }));
  
  beforeEach(() =&gt; {
    fixture = TestBed.createComponent(MyComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });
  
  it('should create', () =&gt; {
    expect(component).toBeTruthy();
  });
  });
  </code></pre>
  
  <p>I look after the problem, the error was:</p>
  
  <blockquote>
    <p>No provider to Store</p>
  </blockquote>
  
  <p>So I add: (I use jasmine for testing)</p>
  
  <pre><code> beforeEach(async(() =&gt; {
  TestBed.configureTestingModule({
    declarations: [ MyComponent ],
    providers: [Store]
   })
   .compileComponents();
  }));
  </code></pre>
  
  <p>Now I got other error:</p>
  
  <blockquote>
    <p>No provider for StateObservable</p>
  </blockquote>
  
  <p>So I add:</p>
  
  <pre><code>  beforeEach(async(() =&gt; {
  TestBed.configureTestingModule({
    declarations: [ MyComponent ],
    providers: [Store, StateObservable]
   })
   .compileComponents();
  }));
  </code></pre>
  
  <p><strong>But now I got new error that I don't know what do to with it:</strong></p>
  
  <blockquote>
  <pre><code>Failed: Can't resolve all parameters for StateObservable: (?).
      Error: Can't resolve all parameters for StateObservable: (?).
          at syntaxError [mywebprojectPath]/node_modules/@angular/compiler/@angular/compiler.es5.js:1689:22)
  </code></pre>
  </blockquote>
  
  <p><strong>What should I do?</strong></p>