feat(testing): add overrideTemplate method (#13372)

Closes #10685
This commit is contained in:
Dzmitry Shylovich
2016-12-15 02:05:17 +03:00
committed by Victor Berchet
parent fd8e15b15d
commit 169ed82900
3 changed files with 22 additions and 1 deletions

View File

@ -135,6 +135,11 @@ export class TestBed implements Injector {
return TestBed;
}
static overrideTemplate(component: Type<any>, template: string): typeof TestBed {
getTestBed().overrideComponent(component, {set: {template, templateUrl: null}});
return TestBed;
}
static get(token: any, notFoundValue: any = Injector.THROW_IF_NOT_FOUND) {
return getTestBed().get(token, notFoundValue);
}