Angular HTTP testing

I am trying to write a unit test for the function below

  public getDataWithAddress(myRequest: Address): Observable<any> {
    const httpOptions = {
      headers: new HttpHeaders({
        'Content-Type': 'application/json',
        'Cache-Control':  'no-cache, no-store, must-revalidate, post-check=0, pre-check=0',
        'Pragma': 'no-cache',
        'Expires': '0'
      })
    };

Address Interface:

export interface Address {
    AddressLine1?: string;
    City?: string;
    StateProvince?: string;
    PostalCode?: string;
    ReturnValues?: string;
}

My unit test

describe('HttpService', () => {
const address= {
    AddressLine1: '3514 W PIERCE ST',
    City: 'PHOENIX',
    StateProvince: 'AZ',
    PostalCode: '85009'
  };
  beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [ 
        HttpClientTestingModule,
        RouterTestingModule
      ],
      providers: [
        HttpService,
        DataMappingService,
        GoogleAnalyticsEventsService
      
      ]
    });
    service =TestBed.get(HttpService);
  });


//Address
             it('expect to retrun addressdata'),
              inject(
                [
                  HttpTestingController,HttpService
                ],
                (httpMock: HttpTestingController, service: HttpService) =>{
                       //We call service for address
                  service.getDataWithAddress(address).subscribe(data => {
                    expect (data).toEqual(address);
                  });
           // We set the expectations for the HttpClient mock
           const req =httpMock.expectOne('http://localhost:4201/api/mydata/address');
           expect(req.request.method).toEqual('POST');
   // Then we set the fake data to be returned by the mock
            req.flush({address});
            httpMock.verify();
          });
        });

when the test runs i get :pending specs

What am i missing here ?

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

Please use the “preformatted text” tool in the editor (</>) to add backticks around text.

Pre-formatted-text

See this post to find the backtick on your keyboard.
Note: Backticks are not single quotes.

markdown_Forums