refactor(ivy): use context discovery in TestBed implementation (#26211)

PR Close #26211
This commit is contained in:
Pawel Kozlowski
2018-09-24 10:30:29 +02:00
committed by Miško Hevery
parent 39f42bad1c
commit 053bf27fb3
6 changed files with 76 additions and 68 deletions

View File

@ -110,7 +110,11 @@ export function getDirectives(target: {}): Array<{}> {
return context.directives || [];
}
function loadContext(target: {}): LContext {
/**
* Returns LContext associated with a target passed as an argument.
* Throws if a given target doesn't have associated LContext.
*/
export function loadContext(target: {}): LContext {
const context = getContext(target);
if (!context) {
throw new Error(