1

I am having an issue with unit testing angular 2 RC4 app with router. It gives me this error :

Can't bind to 'routerLink' since it isn't a known native property ("  <p>Please Go to <a href="/">Home</a></p>

I have implemented testing like this:

    beforeEach(() => {
    addProviders([
        FormBuilder,
        disableDeprecatedForms(),
        provideForms(),
        HTTP_PROVIDERS,
        APP_ROUTER_PROVIDERS,
       ROUTER_DIRECTIVES
    ])
});

Please help me through this process.

Des Horsley
  • 1,858
  • 20
  • 43
Sandeep
  • 121
  • 10

1 Answers1

0

I solved it By doing some workout, this may not be the perfect solution but as I have to do it any way I come with this one :

beforeEach(() => {
  addProviders([
    FormBuilder,
    disableDeprecatedForms(),
    provideForms(),
    HTTP_PROVIDERS,
    APP_ROUTER_PROVIDERS,
   {provide: PLATFORM_DIRECTIVES, multi: true, useValue: ROUTER_DIRECTIVES}
  ])
});
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
Sandeep
  • 121
  • 10