import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { CategoryComponent } from './category.component'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { HttpClientModule } from '@angular/common/http'; import { ActivatedRoute } from '@angular/router'; import { CategoriesService } from '../core/categorys.service'; import { Subject } from 'rxjs'; describe('CategoryComponent', () => { let component: CategoryComponent; let fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [CategoryComponent], schemas: [NO_ERRORS_SCHEMA], imports: [HttpClientModule], providers: [ { provide: ActivatedRoute, useValue: { data: new Subject() } }, CategoriesService ] }).compileComponents(); })); beforeEach(() => { fixture = TestBed.createComponent(CategoryComponent); component = fixture.componentInstance; fixture.detectChanges(); }); it('should be created', () => { expect(component).toBeTruthy(); }); });