title: jasmine unit test "An error was thrown in afterAll"
body: <p>I'm just unit testing whether the component is created or not. Below is my spec file</p>
  
  <pre><code>import { async, ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
  import { CUSTOM_ELEMENTS_SCHEMA, DebugElement } from '@angular/core';
  import { RouterTestingModule } from '@angular/router/testing';
  import { MatTableModule } from '@angular/material';
  import { HttpClientModule, HttpXhrBackend } from '@angular/common/http';
  import { MockBackend } from '@angular/http/testing';
  import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
  
  import { ReleaseListComponent } from './release-list.component';
  import { ReleaseService } from '../release.service';
  
  describe('ReleaseListComponent', () =&gt; {
    let component: ReleaseListComponent;
    let fixture: ComponentFixture&lt;ReleaseListComponent&gt;;
  
    beforeEach(() =&gt; {
      TestBed.configureTestingModule({
        schemas: [CUSTOM_ELEMENTS_SCHEMA],
        imports: [RouterTestingModule, MatTableModule, HttpClientModule ],
        declarations: [ReleaseListComponent],
        providers: [ReleaseService]
      })
        .compileComponents();
    });
  
    beforeEach(() =&gt; {
      fixture = TestBed.createComponent(ReleaseListComponent);
      component = fixture.componentInstance;
      fixture.detectChanges();
    });
  
    it('should create', () =&gt; {
      expect(component).toBeDefined();
    });
  </code></pre>
  
  <p><strong>My component</strong></p>
  
  <pre><code>import { Component, OnInit, ViewChild } from '@angular/core';
  import { ReleaseService } from '../release.service';
  import { MatPaginator, MatSort, MatTableDataSource } from '@angular/material';
  
  @Component({
    selector: 'bw-release-list',
    templateUrl: './release-list.component.html'
  })
  export class ReleaseListComponent implements OnInit {
    title = 'Release notes';
    displayedColumns = ['title'];
    dataSource;
  
    @ViewChild(MatPaginator) paginator: MatPaginator;
    @ViewChild(MatSort) sort: MatSort;
  
    constructor( private releaseNotes: ReleaseService ) { }
  
    ngOnInit() {
      this.releaseNotes.getReleaseNotes()
        .subscribe(data =&gt; {
          this.dataSource = new MatTableDataSource(data.results);
          this.dataSource.paginator = this.paginator;
          this.dataSource.sort = this.sort;
        });
    }
    applyFilter(filterValue: string) {
      filterValue = filterValue.trim();
      filterValue = filterValue.toLowerCase();
      this.dataSource.filter = filterValue;
    }
  }
  </code></pre>
  
  <p>I'm getting <code>An error was thrown in afterAll</code>  I'm trying to debug for hours but no luck.</p>
  
  <p>I tried <code>beforeEach</code> in both <code>async</code> and <code>sync</code>, I've also imported all the dependency file into the spec file. still throwing the same error. </p>
  
  <p>please suggest me on how to resolve this issue.</p>