Skip to content

Commit 975bafa

Browse files
fix: remove zoneless option (#539)
1 parent bb2f9eb commit 975bafa

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

projects/testing-library/src/lib/models.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -506,11 +506,4 @@ export interface Config extends Pick<RenderComponentOptions<any>, 'excludeCompon
506506
* Imports that are added to the imports
507507
*/
508508
defaultImports?: (Type<unknown> | ModuleWithProviders<unknown>)[];
509-
/**
510-
* Set to `true` to use zoneless change detection.
511-
* This automatically adds `provideZonelessChangeDetection` to the default imports.
512-
*
513-
* @default false
514-
*/
515-
zoneless?: boolean;
516509
}

projects/testing-library/src/lib/testing-library.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
SimpleChanges,
1212
Type,
1313
isStandalone,
14-
provideZonelessChangeDetection,
1514
} from '@angular/core';
1615
import { ComponentFixture, DeferBlockBehavior, DeferBlockState, TestBed, tick } from '@angular/core/testing';
1716
import { NavigationExtras, Router } from '@angular/router';
@@ -80,7 +79,6 @@ export async function render<SutType, WrapperType = SutType>(
8079
initialRoute = '',
8180
deferBlockStates = undefined,
8281
deferBlockBehavior = undefined,
83-
zoneless = false,
8482
configureTestBed = () => {
8583
/* noop*/
8684
},
@@ -109,10 +107,7 @@ export async function render<SutType, WrapperType = SutType>(
109107
imports: imports.concat(defaultImports),
110108
routes,
111109
}),
112-
providers: addAutoProviders({
113-
providers: [...providers],
114-
zoneless,
115-
}),
110+
providers,
116111
schemas: [...schemas],
117112
deferBlockBehavior: deferBlockBehavior ?? DeferBlockBehavior.Manual,
118113
});
@@ -523,14 +518,6 @@ function addAutoImports<SutType>(
523518
return [...imports, ...components(), ...routing()];
524519
}
525520

526-
function addAutoProviders({
527-
providers = [],
528-
zoneless,
529-
}: Pick<RenderTemplateOptions<any>, 'providers'> & Pick<Config, 'zoneless'>) {
530-
const provideZoneless = () => (zoneless ? [provideZonelessChangeDetection()] : []);
531-
return [...providers, ...provideZoneless()];
532-
}
533-
534521
async function renderDeferBlock<SutType>(
535522
fixture: ComponentFixture<SutType>,
536523
deferBlockState: DeferBlockState,

0 commit comments

Comments
 (0)