annotate src/app/app.component.spec.ts @ 0:340ce94899fd

chore: initial commit from angular-cli _ _ _ __ _ _ __ __ _ _ _| | __ _ _ __ ___| (_) / _ | _ \ / _ | | | | |/ _ | __|____ / __| | | | (_| | | | | (_| | |_| | | (_| | | |_____| (__| | | \____|_| |_|\__ |\____|_|\____|_| \___|_|_| |___/
author angular-cli <angular-cli@angular.io>
date Tue, 25 Oct 2016 11:40:57 +0100
parents
children 53ea6406d601
rev   line source
angular-cli@0 1 /* tslint:disable:no-unused-variable */
angular-cli@0 2
angular-cli@0 3 import { TestBed, async } from '@angular/core/testing';
angular-cli@0 4 import { AppComponent } from './app.component';
angular-cli@0 5
angular-cli@0 6 describe('App: UglyDuckling', () => {
angular-cli@0 7 beforeEach(() => {
angular-cli@0 8 TestBed.configureTestingModule({
angular-cli@0 9 declarations: [
angular-cli@0 10 AppComponent
angular-cli@0 11 ],
angular-cli@0 12 });
angular-cli@0 13 });
angular-cli@0 14
angular-cli@0 15 it('should create the app', async(() => {
angular-cli@0 16 let fixture = TestBed.createComponent(AppComponent);
angular-cli@0 17 let app = fixture.debugElement.componentInstance;
angular-cli@0 18 expect(app).toBeTruthy();
angular-cli@0 19 }));
angular-cli@0 20
angular-cli@0 21 it(`should have as title 'app works!'`, async(() => {
angular-cli@0 22 let fixture = TestBed.createComponent(AppComponent);
angular-cli@0 23 let app = fixture.debugElement.componentInstance;
angular-cli@0 24 expect(app.title).toEqual('app works!');
angular-cli@0 25 }));
angular-cli@0 26
angular-cli@0 27 it('should render title in a h1 tag', async(() => {
angular-cli@0 28 let fixture = TestBed.createComponent(AppComponent);
angular-cli@0 29 fixture.detectChanges();
angular-cli@0 30 let compiled = fixture.debugElement.nativeElement;
angular-cli@0 31 expect(compiled.querySelector('h1').textContent).toContain('app works!');
angular-cli@0 32 }));
angular-cli@0 33 });