title: Issue with mocking http => returns observable in Angular 7
body: <p>I have an HTTP Interceptor in my angular app where I want to simply return mock data if a certain endpoint is called instead of actually going to the server. </p>
  
  <p>It seems like there's an issue with my observable code as I do not get any errors, but the <code>.subscribe</code> function is not executed. I'm not quite sure what might be happening since I'm not getting any errors.</p>
  
  <p><strong>HttpInterceptor</strong></p>
  
  <pre><code>import {Injectable} from '@angular/core';
  import {
    HttpRequest,
    HttpHandler,
    HttpEvent,
    HttpInterceptor
  } from '@angular/common/http';
  import {Observable} from 'rxjs/Observable';
  import {DemoHttpServer} from './demo-http-server';
  
  @Injectable()
  export class DemoHttpInterceptor implements HttpInterceptor {
  
    constructor(private demoHttpServer: DemoHttpServer) {
  
    }
  
    intercept(request: HttpRequest&lt;any&gt;, next: HttpHandler): Observable&lt;HttpEvent&lt;any&gt;&gt; {
      if (request.url.startsWith('https://demo.company.com/api/')) {
        return this.demoHttpServer.handle(request);
      }
  
      return next.handle(request);
    }
  }
  </code></pre>
  
  <p><strong>Demo HTTP Server</strong></p>
  
  <pre><code>handle(req: HttpRequest&lt;any&gt;): Observable&lt;any&gt; {
      const result = {isMock: true};
  
      return Observable.create((observer: Subscriber&lt;any&gt;) =&gt; {
        observer.next(result);
        observer.complete();
      });
    }
  </code></pre>
  
  <p>In My Component</p>
  
  <pre><code>http.get('https://demo.company.com/api/counts')
  .subscribe(data =&gt; {
    // never get in here..., don't get any console errors
  })
  </code></pre>