title: Mock or override extended class in angular2
body: <p>Hello every body i have some problems with angular2 unit tests. Can anybody help me? <br> I have some class like this <br></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>export class PostcodeApiService extends ApiService {
  
    constructor(Http: Http, auth: AuthService) {
      super(Http, auth);
    }
    
    getPostcodes(filterObject) {
      return super.post('postcodes/filter', filterObject );
    }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>export class ApiService {
  
  
    constructor(private http: Http) {
    }
  
    post(url, payload: any) {
      return new Observable((observer) =&gt; {
          this.http.post(`someUrl/${url}`, payload)
            .map((res: Response) =&gt; res.json())
            .catch((error: any) =&gt; {
              return Observable.throw(error || `Server error ${url}`);
            })
            .subscribe((data) =&gt; {
              observer.next(data);
            });
      });
    }
  
  
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>How can do mock of ApiService.post() function? </p>
  
  <p>My spec file look like this</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>describe('PostcodeApiService', () =&gt; {
  
  
    beforeEach(() =&gt; {
      TestBed.configureTestingModule({
        providers: [
          PostcodeApiService,
          Http,
          ConnectionBackend,
          AuthService,
          UserService
        ],
        imports: [
          HttpModule
        ]
      });
    });
  
    it('should ...', inject([PostcodeApiService], (service: PostcodeApiService) =&gt; {
      // How ovveride post method ?
    }));
    
    
    
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>I would be grateful if you could help me with this thing.
  Thanks for attention!</p>