How do you instantiate a provider in TestBed.configureTestingModule() with an instance of another provider?
An example (doesn't work obviously):
beforeEach(() => {
TestBed.configureTestingModule({
providers: [
{ provide: ServiceOne, useValue: new ServiceOne('parameterOne')},
{ provide: ServiceTwo, useValue: new ServiceTwo(TestBed.get(ServiceOne), 'parameterTwo')}
]
});
});
Aucun commentaire:
Enregistrer un commentaire