title: Expected spy navigate to have been called with: [ [ '/members' ] ] but it was never called
body: <p>I have a service with a method that performs a http delete. If the delete has been succesfull, then I redirect to other page. When I test this method, if the parameter id I pass to it is correct, I expect router.navigate to have been called. But for some reason this does not happen, so I get this report from Jasmine:</p>
  <p>Jasmine spec failure test:</p>
  <pre><code>Service: MemberDelete &gt; Testing deleteMember() succesfully
  Expected spy navigate to have been called with:
    [ [ '/members' ] ]
  but it was never called.
  </code></pre>
  <p>This is my testing file member-delete.service.spec.ts:</p>
  <pre><code>import { HttpClient, HttpResponse} from '@angular/common/http';
  import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
  import { TestBed, async, inject } from '@angular/core/testing';
  import { Router } from '@angular/router';
  import { RouterTestingModule } from '@angular/router/testing';
  import { memberMockObject } from 'src/app/components/member/member.mocks';
  import {createSpyFromClass, Spy} from 'jasmine-auto-spies';
  import { MemberDeleteService } from './member-delete.service';
  import { environment } from '../../../environments/environment';
  
  describe('Service: MemberDelete', () =&gt; {
    let service: MemberDeleteService;
    let mockHttp: HttpClientTestingModule;
    let mockHttpTestingController: HttpTestingController;
    let router: Router;
  
    beforeEach(() =&gt; {
      TestBed.configureTestingModule({
        imports:[
          HttpClientTestingModule,
          RouterTestingModule
        ],
        providers:[
          { provider: MemberDeleteService, useValue: service },
          { provider: HttpClient, useValue: createSpyFromClass(HttpClient) }
        ]
      });
  
      mockHttp = TestBed.inject(HttpClient);
      mockHttpTestingController = TestBed.inject(HttpTestingController);
      service = TestBed.inject(MemberDeleteService);  
      router = TestBed.inject(Router);
    });
  
    afterEach(() =&gt; {
      mockHttpTestingController.verify(); //Verifies that no requests are outstanding.
    });
  
    it('should ...', () =&gt; {
      expect(service).toBeTruthy();
    });
  
    it('Testing deleteMember() succesfully', () =&gt; {
      spyOn(router, 'navigate');
      service.deleteMember(memberMockObject.fakeMember.id);
      expect(router.navigate).toHaveBeenCalledWith(['/members']);
    });
  
  });
  </code></pre>
  <p>This is my service method from member-delete.service.ts:</p>
  <pre><code>public deleteMember(memberId: number): void {
      this._http.delete(`${this._membersUrl}/${memberId}`).subscribe({
        complete: () =&gt; {
          this.router.navigate(
            [`/members`]
          );
        },
        error: (error) =&gt;  {this.handleError(error);} 
      });
    }
  </code></pre>
  <p>Thank you in advance, I really appreciate your help</p>