import { it, expect, describe, inject, async } from '@angular/core/testing'; import { TestComponentBuilder } from '@angular/compiler/testing'; import {Component} from '@angular/core'; @Component({ selector: 'nope', template: `hello`, }) class SimpleComponent { sayHello(): String { return 'hello'; } } describe('Simple Component', () => { it('should render simple component', async(inject([TestComponentBuilder], (tcb: TestComponentBuilder) => { return tcb.createAsync(SimpleComponent).then(fix => { fix.detectChanges(); const compiled = fix.debugElement.nativeElement; expect(compiled).toBeDefined(); }); }))); });