Issue with angular2 tesing DI
<p>I try to test some component with DI. I looking in the common resources like stack/forums etc. But there is no correct answer to my question (I can't found).</p>

<p>When I try to provide mock dependency  I got error about: <em>Token must be defined</em>
What is this? How I can provide mock dependency? (in provided component exist some next level dependency - from <em>http</em> and <em>config</em>, so I can create it in real (because he failed withoud his own dependencies...And I think I must to mock this dependency).</p>

<p>There is my test</p>

<pre><code>import {provide} from 'angular2/core';

import {setBaseTestProviders} from 'angular2/testing';
import {
TEST_BROWSER_PLATFORM_PROVIDERS,
TEST_BROWSER_APPLICATION_PROVIDERS
} from 'angular2/platform/testing/browser';

import { beforeEach,beforeEachProviders,describe,expect,
provide,
it,
inject,
injectAsync,
TestComponentBuilder,
AsyncTestCompleter} from 'angular2/testing';


import {HTTPPatientsListService} from '../../shared/http_services/http_patients_list.service';
import {PatientsListComponent} from './patients_list.component';

class MockClass {}

describe('Patients list Tests', () =&gt; {
  beforeEachProviders(() =&gt; [
    provide(HTTPPatientsListService, {useClass: MockClass})
  ]);

  it('Should defined recentPatientData ', injectAsync([TestComponentBuilder], (tcb: TestComponentBuilder) =&gt; {
    return tcb.createAsync(PatientsListComponent).then((componentFixture: ComponentFixture) =&gt; {
      const element = componentFixture.nativeElement;
      componentFixture.detectChanges();
    });
  }));


});
</code></pre>

<p>There part of my component (only part. it is work correctly, buy he too long)</p>

<pre><code>@Component({
  selector: 'cgm_patients_list',
  templateUrl: `${MODULE_PATH}/patients_list.component.html`,
  styleUrls: [`..${MODULE_PATH}/patients_list.component.css`],
  pipes: [SearchPipe],
  providers: [HTTPPatientsListService],
  directives: [PatientsListDetailComponent]
})

export class PatientsListComponent implements OnInit {
  public recentPatientData;

  private pipedPatientsData;

  constructor(
    private patientsListService: HTTPPatientsListService) {

  }
</code></pre>

<p>thanks for any help...</p>

<p>P.S. Error is:</p>

<pre><code>Chrome 49.0.2623 (Windows 7 0.0.0) Patients list Tests Should defined recentPatientData  FAILED
        Failed: Token must be defined!
        Error: Token must be defined!
            at new BaseException (D:/nucleous/client/src/www/node_modules/angular2/bundles/angular2.dev.js:7521:21)
</code></pre>