vendredi 19 juillet 2019

the Error Encountered undefined provider! is encountered even if the providers are defined

the jasmine test cases are failing after adding active route imports

I Have imported all the dependencies required

all the imports requires is added for active route the providers are included:

Below is the jasmine test cases:

describe('StationConfigComponent', () => {

  let activeRoute;
  // let pdc : PdcWebClient;
  let http: Http;
  beforeEach(async(() => {
    activeRoute = new MockActivatedRoute();

      providers: [{ provide: Router, useClass: RouterStub }, { provide: service, useClass: DataservicesService},
        { provide: toastr, useClass: ToastrManager },  { provide: ActivatedRoute, useValue: activeRoute  },        ,
        { provide: ngxXml2jsonService, useClass: NgxXml2jsonService }, { provide: cdrDetect, useClass: ChangeDetectorRef },
        // { provide: pdc, useClass: PdcWebClient }, 
        { provide: cdrDetect, useClass: 
describe('StationConfigComponent', () => {

the following is the error: Error: Encountered undefined provider! Usually this means you have a circular dependencies. This might be caused by using 'barrel' index.ts files.

Aucun commentaire:

Enregistrer un commentaire