You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f578c08
Browse filesBrowse the repository at this point in the historyBrowse files
fix(@angular/build): prevent missing NgModule scope errors in unit tests
Previously, `rootFiles` was used to restrict TypeScript compilation root names to only the test files to be executed. However, when an application `tsconfig.spec.json` includes application source files (standard for NgModule-based applications), non-standalone components rely on `AppModule` being present in the TypeScript program's root names for the Angular compiler to determine their compilation scope. Restricting root names caused template diagnostic errors such as `NG8001: '<element>' is not a known element`.
This change replaces the root file allowlisting in the unit-test runner with an `excludeRootFiles` option that excludes unselected test files from the compilation roots. This ensures application files and NgModule definitions remain in the program while still ignoring unselected test files with compilation errors.
Closes#34231
0 commit comments