I just upgraded to Angular RC 5 and now all component that uses \'ROUTER_DIRECTIVES\' fails with \'Can\'t resolve all parameters for Router: (?, ?, ?, ?, ?, ?, ?)\' when I t
I was getting the same error, importing RouterTestModule in my imports array, and removing Router/ActivatedRoute from providers and also removing RouterModule from my imports array helped me to get over this issue.
This is how my working version looks like
import { RouterTestingModule } from '@angular/router/testing';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { FormsModule } from '@angular/forms';
import { MyAppComponent } from './my-apppp.component';
import { MyAppService } from '../../../services/my-app.service';
import { NO_ERRORS_SCHEMA} from '@angular/core';
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ MyAppComponent ],
schemas: [NO_ERRORS_SCHEMA],
imports: [ FormsModule, RouterTestingModule ],
providers: [ MyAppService ]
})
.compileComponents();
}));
I know a lot of people already commented in here, but I felt like providing a updated answer would be helpful.
Thanks!