Currently, I am facing a challenge in my Angular test case where I am trying to load JSON data via an HTTP call.
- The issue arises when a static method is called from a service spec file named "url-service.spec" to another service named "load-json.service.spec".
- In the "load-json.pservice.spec" service, an HTTP get request is made to fetch the JSON data, and the subscription happens within that method. The JSON data is then returned, but it does not return an observable back to url-service.
I have tried using spyOn for calling the static method, but I am struggling to inject HTTP, load the JSON, and subscribe within that context.
Any guidance or assistance on this matter would be greatly appreciated. Thank you in advance!