Skip to content

Commit

Permalink
style: remove redundant async in tests
Browse files Browse the repository at this point in the history
In component specs only the `compileComponents` is async thus the `async` on `it` are redudnant

Closes #12161
  • Loading branch information
alan-agius4 authored and vikerman committed Sep 27, 2018
1 parent e18804e commit 3544325
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { TestBed, async } from '@angular/core/testing';<% if (routing) { %>
import { RouterTestingModule } from '@angular/router/testing';<% } %>
import { AppComponent } from './app.component';

describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({<% if (routing) { %>
Expand All @@ -14,22 +14,22 @@ describe('AppComponent', () => {
}).compileComponents();
}));

it('should create the app', async(() => {
it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
});

it(`should have as title '<%= name %>'`, async(() => {
it(`should have as title '<%= name %>'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('<%= name %>');
}));
});

it('should render title in a h1 tag', async(() => {
it('should render title in a h1 tag', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('Welcome to <%= name %>!');
}));
});
});

0 comments on commit 3544325

Please sign in to comment.