Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit ee8ecd3

Browse files
committed
chore(test-bed): add fromInjector constructor to TestBed
Some clients do not generate static factories for test code, and instead directly depend on TestBed constructor. This commit adds a new constructor is basically the injector factory method, requiring only injector vs a full set of parameters. Once clients have been moved to use fromInjector method (or even better a transformer run for test code), we can change the constructor dependencies in a non-breaking way. Closes #1271
1 parent 15570ee commit ee8ecd3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/mock/test_bed.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ class TestBed {
2020

2121
TestBed(this.injector, this.directiveInjector, this.rootScope, this.compiler, this._parser, this.expando);
2222

23+
TestBed.fromInjector(Injector i) :
24+
this(i, i.get(DirectiveInjector), i.get(RootScope), i.get(Compiler),
25+
i.get(Parser), i.get(Expando));
26+
2327

2428
/**
2529
* Use to compile HTML and activate its directives.

0 commit comments

Comments
 (0)