fix(ivy): explicitly compile ngModuleDef for RootScopeModule in R3TestBed (#30037)
This commit unifies the way auxillary RootScopeModule and DynamicTestModule are compiled in R3TestBed by calling `compileNgModuleDefs` explicitly for RootScopeModule. This change also resolves the problem where TestBed's code was used from the @angular/core NPM package: due to the "jit" flag, the @NgModule decorator on the RootScopeModule was transformed to RootScopeModule.decorators = [...], but actual ngModuleDef was never defined. PR Close #30037
This commit is contained in:
parent
8e73f9b0aa
commit
00ce9aab5b
|
@ -505,14 +505,10 @@ export class R3TestBedCompiler {
|
||||||
}
|
}
|
||||||
|
|
||||||
private compileTestModule(): void {
|
private compileTestModule(): void {
|
||||||
const rootProviderOverrides = this.rootProviderOverrides;
|
class RootScopeModule {}
|
||||||
|
compileNgModuleDefs(RootScopeModule as NgModuleType<any>, {
|
||||||
@NgModule({
|
providers: [...this.rootProviderOverrides],
|
||||||
providers: [...rootProviderOverrides],
|
});
|
||||||
jit: true,
|
|
||||||
})
|
|
||||||
class RootScopeModule {
|
|
||||||
}
|
|
||||||
|
|
||||||
const ngZone = new NgZone({enableLongStackTrace: true});
|
const ngZone = new NgZone({enableLongStackTrace: true});
|
||||||
const providers: Provider[] = [
|
const providers: Provider[] = [
|
||||||
|
|
Loading…
Reference in New Issue