@@ -3,50 +3,36 @@ import { AppComponent } from './app.component';
33import { AppModule } from './app.module' ;
44
55describe ( 'AppComponent' , ( ) => {
6- beforeEach (
7- waitForAsync ( ( ) => {
8- TestBed . configureTestingModule ( {
9- imports : [ AppModule ] ,
10- } ) . compileComponents ( ) ;
11- } ) ,
12- ) ;
6+ beforeEach ( waitForAsync ( ( ) => {
7+ TestBed . configureTestingModule ( {
8+ imports : [ AppModule ] ,
9+ } ) . compileComponents ( ) ;
10+ } ) ) ;
1311
14- it (
15- 'should create the app' ,
16- waitForAsync ( ( ) => {
17- const fixture = TestBed . createComponent ( AppComponent ) ;
18- const app = fixture . debugElement . componentInstance ;
19- expect ( app ) . toBeTruthy ( ) ;
20- } ) ,
21- ) ;
12+ it ( 'should create the app' , waitForAsync ( ( ) => {
13+ const fixture = TestBed . createComponent ( AppComponent ) ;
14+ const app = fixture . debugElement . componentInstance ;
15+ expect ( app ) . toBeTruthy ( ) ;
16+ } ) ) ;
2217
23- it (
24- `should have as title 'test-angular-project'` ,
25- waitForAsync ( ( ) => {
26- const fixture = TestBed . createComponent ( AppComponent ) ;
27- const app = fixture . debugElement . componentInstance ;
28- expect ( app . title ) . toEqual ( 'test-angular-project' ) ;
29- } ) ,
30- ) ;
18+ it ( `should have as title 'test-angular-project'` , waitForAsync ( ( ) => {
19+ const fixture = TestBed . createComponent ( AppComponent ) ;
20+ const app = fixture . debugElement . componentInstance ;
21+ expect ( app . title ) . toEqual ( 'test-angular-project' ) ;
22+ } ) ) ;
3123
32- it (
33- 'should render title in a h1 tag' ,
34- waitForAsync ( ( ) => {
35- const fixture = TestBed . createComponent ( AppComponent ) ;
36- fixture . detectChanges ( ) ;
37- const compiled = fixture . debugElement . nativeElement ;
38- expect ( compiled . querySelector ( 'h1' ) . textContent ) . toContain (
39- 'Welcome to test-angular-project!' ,
40- ) ;
41- } ) ,
42- ) ;
24+ it ( 'should render title in a h1 tag' , waitForAsync ( ( ) => {
25+ const fixture = TestBed . createComponent ( AppComponent ) ;
26+ fixture . detectChanges ( ) ;
27+ const compiled = fixture . debugElement . nativeElement ;
28+ expect ( compiled . querySelector ( 'h1' ) . textContent ) . toContain (
29+ 'Welcome to test-angular-project!' ,
30+ ) ;
31+ } ) ) ;
4332
44- it (
45- `should have list of pet store domains` ,
46- waitForAsync ( ( ) => {
47- const fixture = TestBed . createComponent ( AppComponent ) ;
48- const app = fixture . debugElement . componentInstance ;
49- expect ( app . domains ) . toEqual ( [ 'pet.domain' , 'user.domain' ] ) ;
50- } ) ,
51- ) ;
33+ it ( `should have list of pet store domains` , waitForAsync ( ( ) => {
34+ const fixture = TestBed . createComponent ( AppComponent ) ;
35+ const app = fixture . debugElement . componentInstance ;
36+ expect ( app . domains ) . toEqual ( [ 'pet.domain' , 'user.domain' ] ) ;
37+ } ) ) ;
5238} ) ;
0 commit comments