Sorry for 
duplication: https://groups.google.com/forum/#!topic/angular/8cRSrBhpA9w

Am Donnerstag, 13. September 2018 12:25:54 UTC+2 schrieb Nikolaus Koller:
>
>
> Hi there,
>
> I am struggling with DI in my test.
>
> The case is simple. I have a service and when testing I just want to 
> inject a different service.
>
> I did:
>
> beforeEach(() => {
> TestBed.overrideProvider( AuthService, {useValue: MockAuthService(??) });
> TestBed.configureTestingModule({
>  declarations: [ LoginComponent ],
>  providers: [ AuthService ]
> }).compileComponents();
> page = new AppPage();
>
> }
>
>
>
> MockAuthService inherits from real AuthService. There I inject another 
> service in the constructor. I dont know how to do that here.
>
>
> Is there another way? What is wrong?
>
>
> Thx a lot and best regards,
>
> Nikolaus 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to