import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { GameCreateComponent } from './game-create.component'; import {GamesService} from '../shared/games.service'; import {PlatformsService} from '../shared/platforms.service'; import {BrowserModule} from '@angular/platform-browser'; import {APP_BASE_HREF, CommonModule} from '@angular/common'; import {HttpClientModule} from '@angular/common/http'; import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {RouterModule} from '@angular/router'; import {StoreModule} from '@ngrx/store'; import {EffectsModule} from '@ngrx/effects'; describe('GameCreateComponent', () => { let component: GameCreateComponent; let fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ imports: [ BrowserModule, CommonModule, HttpClientModule, FormsModule, ReactiveFormsModule, RouterModule.forRoot([]), StoreModule.forRoot([]), EffectsModule ], declarations: [ GameCreateComponent ], providers: [ GamesService, PlatformsService, { provide: APP_BASE_HREF, useValue : '/' } ] }) .compileComponents(); })); beforeEach(() => { fixture = TestBed.createComponent(GameCreateComponent); component = fixture.componentInstance; fixture.detectChanges(); }); it('should create', () => { expect(component).toBeTruthy(); }); it(`should have the title 'Create new game'`, () => { expect(component.title).toEqual('Create new game'); }); });