Repository navigation
fix(@angular/build): only compile included test files in unit-test builder - #34134
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a rootFiles option to the Angular application builder and compiler options, allowing the TypeScript compilation to restrict its root names to only the specified files (such as test, setup, and provider files). This change prevents compilation errors in non-included test files during unit testing. The feedback suggests ensuring that if a custom main file is provided in the Karma options, it is also included in the rootFiles list to avoid compilation warnings or errors.
5f80743 to
3317656
Compare
3317656 to
d492fce
Compare
78b801b to
195d9e3
Compare
…ilder When running the `unit-test` builder with `--include`, TypeScript compilation previously compiled all test files matched by the tsconfig file, causing compilation errors in unrelated test files to fail the test run. This change introduces a `rootFiles` option that restricts the TypeScript program's root files to only the test files to be executed (plus setup files and providers), while preserving ambient `.d.ts` declaration files discovered by `readConfiguration`. Fixes angular#34089
195d9e3 to
aeb7fc3
Compare
|
This pull request has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
When running the
unit-testbuilder with--include, TypeScript compilation previously compiled all test files matched by the tsconfig file, causing compilation errors in unrelated test files to fail the test run.This change introduces a
rootFilesoption that restricts the TypeScript program's root files to only the test files to be executed (plus setup files and providers), while preserving ambient.d.tsdeclaration files discovered byreadConfiguration.Fixes #34089