@@ -88,107 +88,107 @@ export function main() {
8888
8989 describe ( 'bootstrap factory method' , ( ) => {
9090 it ( 'should throw if no View found' , inject ( [ AsyncTestCompleter ] , ( async ) => {
91- var injectorPromise = bootstrap ( HelloRootMissingTemplate , testBindings , ( e , t ) => { throw e ; } ) ;
92- PromiseWrapper . then ( injectorPromise , null , ( reason ) => {
91+ var refPromise = bootstrap ( HelloRootMissingTemplate , testBindings , ( e , t ) => { throw e ; } ) ;
92+ PromiseWrapper . then ( refPromise , null , ( reason ) => {
9393 expect ( reason . message ) . toContain ( 'No template found for HelloRootMissingTemplate' ) ;
9494 async . done ( ) ;
9595 } ) ;
9696 } ) ) ;
9797
9898 it ( 'should throw if bootstrapped Directive is not a Component' , inject ( [ AsyncTestCompleter ] , ( async ) => {
99- var injectorPromise = bootstrap ( HelloRootDirectiveIsNotCmp , testBindings , ( e , t ) => { throw e ; } ) ;
100- PromiseWrapper . then ( injectorPromise , null , ( reason ) => {
99+ var refPromise = bootstrap ( HelloRootDirectiveIsNotCmp , testBindings , ( e , t ) => { throw e ; } ) ;
100+ PromiseWrapper . then ( refPromise , null , ( reason ) => {
101101 expect ( reason . message ) . toContain ( `Could not load 'HelloRootDirectiveIsNotCmp' because it is not a component.` ) ;
102102 async . done ( ) ;
103103 } ) ;
104104 } ) ) ;
105105
106106 it ( 'should throw if no element is found' , inject ( [ AsyncTestCompleter ] , ( async ) => {
107- var injectorPromise = bootstrap ( HelloRootCmp , [ ] , ( e , t ) => { throw e ; } ) ;
108- PromiseWrapper . then ( injectorPromise , null , ( reason ) => {
107+ var refPromise = bootstrap ( HelloRootCmp , [ ] , ( e , t ) => { throw e ; } ) ;
108+ PromiseWrapper . then ( refPromise , null , ( reason ) => {
109109 expect ( reason . message ) . toContain (
110110 'The app selector "hello-app" did not match any elements' ) ;
111111 async . done ( ) ;
112112 } ) ;
113113 } ) ) ;
114114
115115 it ( 'should create an injector promise' , ( ) => {
116- var injectorPromise = bootstrap ( HelloRootCmp , testBindings ) ;
117- expect ( injectorPromise ) . not . toBe ( null ) ;
116+ var refPromise = bootstrap ( HelloRootCmp , testBindings ) ;
117+ expect ( refPromise ) . not . toBe ( null ) ;
118118 } ) ;
119119
120120 it ( 'should resolve an injector promise and contain bindings' , inject ( [ AsyncTestCompleter ] , ( async ) => {
121- var injectorPromise = bootstrap ( HelloRootCmp , testBindings ) ;
122- injectorPromise . then ( ( injector ) => {
123- expect ( injector . get ( appElementToken ) ) . toBe ( el ) ;
121+ var refPromise = bootstrap ( HelloRootCmp , testBindings ) ;
122+ refPromise . then ( ( ref ) => {
123+ expect ( ref . injector . get ( appElementToken ) ) . toBe ( el ) ;
124124 async . done ( ) ;
125125 } ) ;
126126 } ) ) ;
127127
128128 it ( 'should provide the application component in the injector' , inject ( [ AsyncTestCompleter ] , ( async ) => {
129- var injectorPromise = bootstrap ( HelloRootCmp , testBindings ) ;
130- injectorPromise . then ( ( injector ) => {
131- expect ( injector . get ( HelloRootCmp ) ) . toBeAnInstanceOf ( HelloRootCmp ) ;
129+ var refPromise = bootstrap ( HelloRootCmp , testBindings ) ;
130+ refPromise . then ( ( ref ) => {
131+ expect ( ref . injector . get ( HelloRootCmp ) ) . toBeAnInstanceOf ( HelloRootCmp ) ;
132132 async . done ( ) ;
133133 } ) ;
134134 } ) ) ;
135135
136136 it ( 'should display hello world' , inject ( [ AsyncTestCompleter ] , ( async ) => {
137- var injectorPromise = bootstrap ( HelloRootCmp , testBindings ) ;
138- injectorPromise . then ( ( injector ) => {
139- expect ( injector . get ( appElementToken ) ) . toHaveText ( 'hello world!' ) ;
137+ var refPromise = bootstrap ( HelloRootCmp , testBindings ) ;
138+ refPromise . then ( ( ref ) => {
139+ expect ( ref . injector . get ( appElementToken ) ) . toHaveText ( 'hello world!' ) ;
140140 async . done ( ) ;
141141 } ) ;
142142 } ) ) ;
143143
144144 it ( 'should support multiple calls to bootstrap' , inject ( [ AsyncTestCompleter ] , ( async ) => {
145- var injectorPromise1 = bootstrap ( HelloRootCmp , testBindings ) ;
146- var injectorPromise2 = bootstrap ( HelloRootCmp2 , testBindings ) ;
147- PromiseWrapper . all ( [ injectorPromise1 , injectorPromise2 ] ) . then ( ( injectors ) => {
148- expect ( injectors [ 0 ] . get ( appElementToken ) ) . toHaveText ( 'hello world!' ) ;
149- expect ( injectors [ 1 ] . get ( appElementToken ) ) . toHaveText ( 'hello world, again!' ) ;
145+ var refPromise1 = bootstrap ( HelloRootCmp , testBindings ) ;
146+ var refPromise2 = bootstrap ( HelloRootCmp2 , testBindings ) ;
147+ PromiseWrapper . all ( [ refPromise1 , refPromise2 ] ) . then ( ( refs ) => {
148+ expect ( refs [ 0 ] . injector . get ( appElementToken ) ) . toHaveText ( 'hello world!' ) ;
149+ expect ( refs [ 1 ] . injector . get ( appElementToken ) ) . toHaveText ( 'hello world, again!' ) ;
150150 async . done ( ) ;
151151 } ) ;
152152 } ) ) ;
153153
154154 it ( "should make the provided bindings available to the application component" , inject ( [ AsyncTestCompleter ] , ( async ) => {
155- var injectorPromise = bootstrap ( HelloRootCmp3 , [
155+ var refPromise = bootstrap ( HelloRootCmp3 , [
156156 testBindings ,
157157 bind ( "appBinding" ) . toValue ( "BoundValue" )
158158 ] ) ;
159159
160- injectorPromise . then ( ( injector ) => {
161- expect ( injector . get ( HelloRootCmp3 ) . appBinding ) . toEqual ( "BoundValue" ) ;
160+ refPromise . then ( ( ref ) => {
161+ expect ( ref . injector . get ( HelloRootCmp3 ) . appBinding ) . toEqual ( "BoundValue" ) ;
162162 async . done ( ) ;
163163 } ) ;
164164 } ) ) ;
165165
166166 it ( "should avoid cyclic dependencies when root component requires Lifecycle through DI" , inject ( [ AsyncTestCompleter ] , ( async ) => {
167- var injectorPromise = bootstrap ( HelloRootCmp4 , testBindings ) ;
167+ var refPromise = bootstrap ( HelloRootCmp4 , testBindings ) ;
168168
169- injectorPromise . then ( ( injector ) => {
170- expect ( injector . get ( HelloRootCmp4 ) . lc ) . toBe ( injector . get ( LifeCycle ) ) ;
169+ refPromise . then ( ( ref ) => {
170+ expect ( ref . injector . get ( HelloRootCmp4 ) . lc ) . toBe ( ref . injector . get ( LifeCycle ) ) ;
171171 async . done ( ) ;
172172 } ) ;
173173 } ) ) ;
174174
175175 it ( "should support shadow dom content tag" , inject ( [ AsyncTestCompleter ] , ( async ) => {
176- var injectorPromise = bootstrap ( HelloRootCmpContent , testBindings ) ;
177- injectorPromise . then ( ( injector ) => {
178- expect ( injector . get ( appElementToken ) ) . toHaveText ( 'before: loading after: done' ) ;
176+ var refPromise = bootstrap ( HelloRootCmpContent , testBindings ) ;
177+ refPromise . then ( ( ref ) => {
178+ expect ( ref . injector . get ( appElementToken ) ) . toHaveText ( 'before: loading after: done' ) ;
179179 async . done ( ) ;
180180 } ) ;
181181 } ) ) ;
182182
183183 it ( 'should register each application with the testability registry' , inject ( [ AsyncTestCompleter ] , ( async ) => {
184- var injectorPromise1 = bootstrap ( HelloRootCmp , testBindings ) ;
185- var injectorPromise2 = bootstrap ( HelloRootCmp2 , testBindings ) ;
184+ var refPromise1 = bootstrap ( HelloRootCmp , testBindings ) ;
185+ var refPromise2 = bootstrap ( HelloRootCmp2 , testBindings ) ;
186186
187- PromiseWrapper . all ( [ injectorPromise1 , injectorPromise2 ] ) . then ( ( injectors ) => {
188- var registry = injectors [ 0 ] . get ( TestabilityRegistry ) ;
187+ PromiseWrapper . all ( [ refPromise1 , refPromise2 ] ) . then ( ( refs ) => {
188+ var registry = refs [ 0 ] . injector . get ( TestabilityRegistry ) ;
189189 PromiseWrapper . all ( [
190- injectors [ 0 ] . asyncGet ( Testability ) ,
191- injectors [ 1 ] . asyncGet ( Testability ) ] ) . then ( ( testabilities ) => {
190+ refs [ 0 ] . injector . asyncGet ( Testability ) ,
191+ refs [ 1 ] . injector . asyncGet ( Testability ) ] ) . then ( ( testabilities ) => {
192192 expect ( registry . findTestabilityInTree ( el ) ) . toEqual ( testabilities [ 0 ] ) ;
193193 expect ( registry . findTestabilityInTree ( el2 ) ) . toEqual ( testabilities [ 1 ] ) ;
194194 async . done ( ) ;
0 commit comments