title: angular 8 jest test `toHaveBeenCalledWith` fails, how to test api url calls?
body: <p>In my test spec, I would like to insure 2 stuffs.</p>
  
  <pre><code>1. dummy data maching with model and get response.
  2. find the `api` called with correct url.
  </code></pre>
  
  <p>I am trying those, but getting error as:</p>
  
  <p><code>SubsystemServiceService › get susbsytem collection › should call get the subsytem collection</code></p>
  
  <p>as well i would like to update my spec file to insure the both my requirement. any one please help  me out here?</p>
  
  <p>here is my spec.ts file:</p>
  
  <pre><code>import { TestBed } from '@angular/core/testing';
  import { HttpClient } from '@angular/common/http';
  import { cold } from 'jasmine-marbles';
  import { ModelSubSystem } from './../models/model.subSystem';
  import { SubsystemService } from './subsystem-service';
  
  describe('SubsystemServiceService', () =&gt; {
  
      let service: SubsystemService;
      let http: HttpClient;
  
      const data1 = {
          Id: 0,
          Name: 'subsystem1',
          IsDeletePossible: true,
          CreatedBy: '',
          CreatedDate: new Date(),
          UpdatedBy: '',
          UpdatedDate: new Date(),
          UpdatedByName: '',
          CreatedByName: ''
      } as ModelSubSystem;
  
      const data2 = {
          Id: 0,
          Name: 'subsystem2',
          IsDeletePossible: true,
          CreatedBy: '',
          CreatedDate: new Date(),
          UpdatedBy: '',
          UpdatedDate: new Date(),
          UpdatedByName: '',
          CreatedByName: ''
      } as ModelSubSystem;
  
      const subsystems = [data1, data2];
  
      beforeEach(() =&gt; {
  
          TestBed.configureTestingModule({
              providers: [{ provide: HttpClient, useValue: { get: jest.fn() } }]
          });
  
          service = TestBed.get(SubsystemService);
          http = TestBed.get(HttpClient);
  
      });
  
      describe('get susbsytem collection', () =&gt; {
  
          it('should call get the subsytem collection', () =&gt; {
  
              const response = cold('(-a|)', { a: subsystems });
              http.get = jest.fn(() =&gt; response);
  
              expect(http.get).toHaveBeenCalledWith(`https://ewsanedevaoscmsapi01-as.websites.net/api/SubSystem`);
  
          });
      });
  
      it('should be created', () =&gt; {
          expect(service).toBeTruthy();
      });
  
  });
  </code></pre>