Mercurial > hg > ugly-duckling
annotate src/app/app.component.spec.ts @ 40:f7244f2155a3
Setup some scaffolding for bootstrapping a worker and loading into a service, providing a mechanism for implementing most of the logic which runs inside the worker in TypeScript.
author | Lucas Thompson <dev@lucas.im> |
---|---|
date | Thu, 01 Dec 2016 15:46:33 +0000 |
parents | 340ce94899fd |
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 }); |