@@ -26,6 +26,7 @@ import { RenderComponentOptions, RenderDirectiveOptions, RenderResult } from './
26
26
import { getConfig } from './config' ;
27
27
28
28
const mountedFixtures = new Set < ComponentFixture < any > > ( ) ;
29
+ const inject = TestBed . inject || TestBed . get ;
29
30
30
31
export async function render < ComponentType > (
31
32
component : Type < ComponentType > ,
@@ -129,7 +130,6 @@ export async function render<SutType, WrapperType = SutType>(
129
130
fixture . componentRef . injector . get ( ChangeDetectorRef ) . detectChanges ( ) ;
130
131
} ;
131
132
132
- const inject = TestBed . inject || TestBed . get ;
133
133
let router = routes ? inject ( Router ) : null ;
134
134
const zone = inject ( NgZone ) ;
135
135
const navigate = async ( elementOrPath : Element | string , basePath = '' ) => {
@@ -185,7 +185,7 @@ export async function render<SutType, WrapperType = SutType>(
185
185
186
186
async function createComponent < SutType > ( component : Type < SutType > ) : Promise < ComponentFixture < SutType > > {
187
187
/* Make sure angular application is initialized before creating component */
188
- await TestBed . inject ( ApplicationInitStatus ) . donePromise ;
188
+ await inject ( ApplicationInitStatus ) . donePromise ;
189
189
return TestBed . createComponent ( component ) ;
190
190
}
191
191
0 commit comments