title: Test pipe with dependencies on services
body: <p>I have a pipe that sanatises HTML as below:</p>
  
  <pre><code>import { Pipe, PipeTransform } from '@angular/core';
  import { DomSanitizer } from '@angular/platform-browser';
  
  @Pipe({
      name: 'sanitiseHtml'
  })
  
  export class SanitiseHtmlPipe implements PipeTransform {
  
  constructor(private _sanitizer: DomSanitizer) {}
  
      transform(value: any): any {
        return this._sanitizer.bypassSecurityTrustHtml(value);
      }
  
  }
  </code></pre>
  
  <p>I want to test it as below:</p>
  
  <pre><code>describe('Pipe: Sanatiser', () =&gt; {
      let pipe: SanitiseHtmlPipe;
  
      beforeEach(() =&gt; {
          pipe = new SanitiseHtmlPipe(new DomSanitizer());
      });
  
      it('create an instance', () =&gt; {
          expect(pipe).toBeTruthy();
      }); 
  });
  </code></pre>
  
  <p>The DomSanatizer is an abstract class which is autowired by typescript by passing it into a constructor:</p>
  
  <pre><code>constructor(private _sanitizer: DomSanitizer) {}
  </code></pre>
  
  <p>Currently I get the typescript errror:</p>
  
  <blockquote>
    <p>Cannot create an instance of the abstract class 'DomSanitizer'.</p>
  </blockquote>
  
  <p>Does anyone know what typescript does when instantiating dependencies passed into a constructor in Angular? Or what the way to test something like this is?</p>