mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
test(aio): remove compileComponents from all tests
By reflex we began all component tests with an async `beforeEach` that called `compileComponents`. In at least one case (`live-example.component.spec.ts`) that led to the `it` tests being async as well. There is no need to call `.compileComponents` because CLI web pack + plugin inlines all templates and styles. While `.compileComponents` was harmless, it added complexity and distraction which we should not inflict on future readers and testers.
This commit is contained in:
committed by
Pete Bacon Darwin
parent
44195858e6
commit
2ee7662737
@@ -41,7 +41,7 @@ describe('CodeComponent', () => {
|
||||
delete window['prettyPrintOne'];
|
||||
});
|
||||
|
||||
beforeEach(async(() => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ MdSnackBarModule, NoopAnimationsModule ],
|
||||
declarations: [ CodeComponent, HostComponent ],
|
||||
@@ -50,9 +50,8 @@ describe('CodeComponent', () => {
|
||||
CopierService,
|
||||
{provide: Logger, useClass: TestLogger }
|
||||
]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
// Must be async because
|
||||
// CodeComponent creates PrettyPrintService which async loads `prettify.js`.
|
||||
|
||||
Reference in New Issue
Block a user