import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { AppComponent, CarouselComponent } from '../'; import { CarouselService, WindowWidthService } from '../../services'; describe('AppComponent', () => { let component: AppComponent; let fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [ AppComponent, CarouselComponent ], providers: [CarouselService, WindowWidthService], schemas: [CUSTOM_ELEMENTS_SCHEMA] }) .compileComponents(); })); beforeEach(() => { fixture = TestBed.createComponent(AppComponent); component = fixture.componentInstance; fixture.detectChanges(); }); it('should create', () => { expect(component).toBeTruthy(); }); it('should contains image sources', () => { expect((component as any).imageSources).toBeDefined(); }); it('should contains config', () => { expect((component as any).config).toBeDefined(); }); });