Relative Content

Tag Archive for angularunit-testingjasmine

Jasmine test Observable

I have a service class in an Angular application that I need to write tests for. The service class works well, but I am unable to write the Jasmine unit test.

Jasmine not waiting for an inner Subscription

I have a service that serves a very specific case, gets data from websocket and has to be called recursively to get all results. I’ve managed the service and it looks pretty decent works pretty fast but after trying loads of different ways and even rejigging bits of service, I’ve been unable to write a test for the service.
The service is like so

Angular unit testing for chained promise

I am learning Angular unit test for chained promise . Here is code snippet and failed at expectation with error message Expected ” to equal ‘bar’. What is needed to make it success ? I have used Angular 17 and Jasmine.I have tried with fakeAsync with tick & flush .