mercredi 20 février 2019

Angular testing private methods [duplicate]

I've built a kinda Queue manager which works with RxJs observables and executes them one by one. Now I want to test this, however all the methods that I want to test are private.

Public interface has only two methods that create an observable and add it to the queue manager.

If I try to make something like spyOn(myService, 'privateMethod') PhpStorm analysis says that it is not assignable to type (and refers to public methods).

I can't extract this into something where these would become public because it's a complicated logic which should not be interrupted from the outside.

Aucun commentaire:

Enregistrer un commentaire