title: Unit testing component throwing transform is not a function for a pipe
body: <p>in my component class i have following get method:</p>
  <pre><code>get getCSVForDownload() {
      return defer(() =&gt; {
          this.downloadingData = true;
          return this.csvRepoService.getCSV(this.csvId).pipe(
              map((items: ICSV[]) =&gt; {
                  let filteredItems = items;
                  filteredItems = this.filterDateRangePipe.transform(filteredItems, this.timeFilterRange, 'createdDate');
                  return filteredItems;
              }),
           );
      });
  </code></pre>
  <p>in the spec file of that component first I have created a mock pipe like this:</p>
  <pre><code>@Pipe({ name: 'filter' })
  class MockPipe implements PipeTransform {
   public transform(items: any[], timeFilterRange: TimeFilterRange, fieldName: string): any   {
       return items;
    }
  }
  </code></pre>
  <p>And in the beforeEach i have provided the pipe in following way:</p>
  <pre><code> beforeEach(async () =&gt; {
  
      await TestBed.configureTestingModule({
          declarations: [ABCComponent],
          imports: [
              HttpClientTestingModule,
          ],
          providers: [
              { provide: FilterDateRangePipe, useValue: MockPipe },
              { provide: SecurityService, useValue: mockSecurityService }
          ],
          schemas: [CUSTOM_ELEMENTS_SCHEMA]
      }).compileComponents();
      mockCsvRepoService = TestBed.inject(CsvRepoService );
      spyOn(mockCsvRepoService, 'getCSV').and.returnValue(of(testCSVs));
  });
  </code></pre>
  <p>And the test I have written is following:</p>
  <pre><code>it('Should call getCSV when downloadCSV triggered', fakeAsync(() =&gt; {
      component.getCSVForDownload.subscribe()
      expect(mockCsvRepoService.getCSV).toHaveBeenCalled()
      flush();
    }));
  </code></pre>
  <p>Though I have provided mock object for FilterDateRangePipe which has transform method in it, I am still getting error like following</p>
  <pre><code> TypeError: this.filterDateRangePipe.transform is not a function
  </code></pre>
  <p>What I am missing?</p>