11import { Type , DebugElement } from '@angular/core' ;
2- import { ComponentFixture } from '@angular/core/testing' ;
2+ import { ComponentFixture , TestBed } from '@angular/core/testing' ;
33import { Routes } from '@angular/router' ;
44import { BoundFunction , Queries , queries , Config as dtlConfig , PrettyDOMOptions } from '@testing-library/dom' ;
55
@@ -74,7 +74,7 @@ export interface RenderComponentOptions<ComponentType, Q extends Queries = typeo
7474 * true
7575 *
7676 * @example
77- * const component = await render(AppComponent, {
77+ * await render(AppComponent, {
7878 * autoDetectChanges: false
7979 * })
8080 */
@@ -87,7 +87,7 @@ export interface RenderComponentOptions<ComponentType, Q extends Queries = typeo
8787 * true
8888 *
8989 * @example
90- * const component = await render(AppComponent, {
90+ * await render(AppComponent, {
9191 * detectChangesOnRender: false
9292 * })
9393 */
@@ -103,7 +103,7 @@ export interface RenderComponentOptions<ComponentType, Q extends Queries = typeo
103103 * []
104104 *
105105 * @example
106- * const component = await render(AppComponent, {
106+ * await render(AppComponent, {
107107 * declarations: [ CustomerDetailComponent, ButtonComponent ]
108108 * })
109109 */
@@ -118,7 +118,7 @@ export interface RenderComponentOptions<ComponentType, Q extends Queries = typeo
118118 * []
119119 *
120120 * @example
121- * const component = await render(AppComponent, {
121+ * await render(AppComponent, {
122122 * providers: [
123123 * CustomersService,
124124 * {
@@ -140,7 +140,7 @@ export interface RenderComponentOptions<ComponentType, Q extends Queries = typeo
140140 * `[NoopAnimationsModule]`
141141 *
142142 * @example
143- * const component = await render(AppComponent, {
143+ * await render(AppComponent, {
144144 * imports: [
145145 * AppSharedModule,
146146 * MaterialModule,
@@ -159,7 +159,7 @@ export interface RenderComponentOptions<ComponentType, Q extends Queries = typeo
159159 * []
160160 *
161161 * @example
162- * const component = await render(AppComponent, {
162+ * await render(AppComponent, {
163163 * schemas: [
164164 * NO_ERRORS_SCHEMA,
165165 * ]
@@ -174,7 +174,7 @@ export interface RenderComponentOptions<ComponentType, Q extends Queries = typeo
174174 * {}
175175 *
176176 * @example
177- * const component = await render(AppComponent, {
177+ * await render(AppComponent, {
178178 * componentProperties: {
179179 * counterValue: 10,
180180 * send: (value) => { ... }
@@ -190,7 +190,7 @@ export interface RenderComponentOptions<ComponentType, Q extends Queries = typeo
190190 * {}
191191 *
192192 * @example
193- * const component = await render(AppComponent, {
193+ * await render(AppComponent, {
194194 * componentInputs: {
195195 * counterValue: 10
196196 * }
@@ -206,7 +206,7 @@ export interface RenderComponentOptions<ComponentType, Q extends Queries = typeo
206206 *
207207 * @example
208208 * const sendValue = (value) => { ... }
209- * const component = await render(AppComponent, {
209+ * await render(AppComponent, {
210210 * componentOutputs: {
211211 * send: {
212212 * emit: sendValue
@@ -225,7 +225,7 @@ export interface RenderComponentOptions<ComponentType, Q extends Queries = typeo
225225 * []
226226 *
227227 * @example
228- * const component = await render(AppComponent, {
228+ * await render(AppComponent, {
229229 * componentProviders: [
230230 * AppComponentService
231231 * ]
@@ -259,7 +259,7 @@ export interface RenderComponentOptions<ComponentType, Q extends Queries = typeo
259259 * undefined
260260 *
261261 * @example
262- * const component = await render(AppComponent, {
262+ * await render(AppComponent, {
263263 * componentImports: [
264264 * MockChildComponent
265265 * ]
@@ -277,7 +277,7 @@ export interface RenderComponentOptions<ComponentType, Q extends Queries = typeo
277277 * import * as customQueries from 'custom-queries'
278278 * import { queries } from '@testing-library/angular'
279279 *
280- * const component = await render(AppComponent, {
280+ * await render(AppComponent, {
281281 * queries: { ...queries, ...customQueries }
282282 * })
283283 */
@@ -291,7 +291,7 @@ export interface RenderComponentOptions<ComponentType, Q extends Queries = typeo
291291 * false
292292 *
293293 * @example
294- * const component = await render(AppComponent, {
294+ * await render(AppComponent, {
295295 * imports: [AppModule], // a module that includes AppComponent
296296 * excludeComponentDeclaration: true
297297 * })
@@ -304,7 +304,7 @@ export interface RenderComponentOptions<ComponentType, Q extends Queries = typeo
304304 * For more info see https://angular.io/api/router/Routes.
305305 *
306306 * @example
307- * const component = await render(AppComponent, {
307+ * await render(AppComponent, {
308308 * declarations: [ChildComponent],
309309 * routes: [
310310 * {
@@ -326,7 +326,7 @@ export interface RenderComponentOptions<ComponentType, Q extends Queries = typeo
326326 * Specifies which route should be initially navigated to
327327 *
328328 * @example
329- * const component = await render(AppComponent, {
329+ * await render(AppComponent, {
330330 * initialRoute: 'myroute',
331331 * routes: [
332332 * { path: '', component: HomeComponent },
@@ -344,11 +344,25 @@ export interface RenderComponentOptions<ComponentType, Q extends Queries = typeo
344344 * `false`
345345 *
346346 * @example
347- * const component = await render(AppComponent, {
347+ * await render(AppComponent, {
348348 * removeAngularAttributes: true
349349 * })
350350 */
351351 removeAngularAttributes ?: boolean ;
352+
353+ /**
354+ * @description
355+ * Callback to configure the testbed before the compilation.
356+ *
357+ * @default
358+ * () => {}
359+ *
360+ * @example
361+ * await render(AppComponent, {
362+ * configureTestBed: (testBed) => { }
363+ * })
364+ */
365+ configureTestBed ?: ( testbed : TestBed ) => void ;
352366}
353367
354368export interface ComponentOverride < T > {
@@ -368,7 +382,7 @@ export interface RenderTemplateOptions<WrapperType, Properties extends object =
368382 * `WrapperComponent`, an empty component that strips the `ng-version` attribute
369383 *
370384 * @example
371- * const component = await render(`<div spoiler message='SPOILER'></div>`, {
385+ * await render(`<div spoiler message='SPOILER'></div>`, {
372386 * declarations: [SpoilerDirective]
373387 * wrapper: CustomWrapperComponent
374388 * })
0 commit comments