I answered the following link to get the answers, but I did not find a working solution for my scenario.
Error: (SystemJS) Cannot resolve all parameters for ActivatedRoute: (?,?,?,?,?,?,?,?)
Therefore, I am trying to remove the Activated Route from the providers, but the test bed fails. He shows
Error: no provider ActivatedRoute!
So, here is my code, I want to run a test bed in an angular application using Jasmine.
import { ActivatedRoute } from '@angular/router';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterModule, Routes } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';
describe('SomeComponent', () => {
let component: SomeComponent;
let fixture: ComponentFixture<SomeComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [ RouterModule, RouterTestingModule ],
declarations: [ SomeComponent ],
providers: [ ActivatedRoute ],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(SomeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
Error receiving

source
share