Repository navigation
Closed as not planned
Labels
Milestone
Description
Command
test
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
Currently an ng test will warn if the builder used is not @angular/build:application or @angular/build:ng-packagr.
There are packages such as angular-builder/custom-esbuild that provide their own builder and using one will warn. This feels incorrect. Can we change the logic around the warning to ensure custom builders do not get one?
Minimal Reproduction
The logic for the warning is available here ->
angular-cli/packages/angular/build/src/builders/unit-test/builder.ts
Lines 247 to 268 in 11ab5eb
| if (builderName === '@angular/build:application') { | |
| buildTargetOptions = (await context.validateOptions( | |
| await context.getTargetOptions(normalizedOptions.buildTarget), | |
| builderName, | |
| )) as unknown as ApplicationBuilderInternalOptions; | |
| } else if (builderName === '@angular/build:ng-packagr') { | |
| const ngPackagrOptions = await context.validateOptions( | |
| await context.getTargetOptions(normalizedOptions.buildTarget), | |
| builderName, | |
| ); | |
| buildTargetOptions = await transformNgPackagrOptions( | |
| context, | |
| ngPackagrOptions, | |
| normalizedOptions.projectRoot, | |
| ); | |
| } else { | |
| context.logger.warn( | |
| `The 'buildTarget' is configured to use '${builderName}', which is not supported. ` + | |
| `The 'unit-test' builder is designed to work with '@angular/build:application' or '@angular/build:ng-packagr'. ` + | |
| 'Unexpected behavior or build failures may occur.', | |
| ); |
Exception or Error
`The 'buildTarget' is configured to use '@angular-builders/custom-esbuild:application', which is not supported. The 'unit-test' builder is designed to work with '@angular/build:application' or '@angular/build:ng-packagr'. Unexpected behavior or build failures may occur.`
Your Environment
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI : 22.1.3
Angular : 22.1.0
Node.js : 22.22.3
Package Manager : npm 10.9.8
Operating System : darwin arm64
┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/animations │ 22.1.0 │ ^22.1.0 │
│ @angular/build │ 22.1.3 │ ^22.1.3 │
│ @angular/cli │ 22.1.3 │ ^22.1.3 │
│ @angular/common │ 22.1.0 │ ^22.1.0 │
│ @angular/compiler │ 22.1.0 │ ^22.1.0 │
│ @angular/compiler-cli │ 22.1.0 │ ^22.1.0 │
│ @angular/core │ 22.1.0 │ ^22.1.0 │
│ @angular/elements │ 22.1.0 │ ^22.1.0 │
│ @angular/forms │ 22.1.0 │ ^22.1.0 │
│ @angular/platform-browser │ 22.1.0 │ ^22.1.0 │
│ @angular/router │ 22.1.0 │ ^22.1.0 │
│ ng-packagr │ 22.1.1 │ 22.1.1 │
│ rxjs │ 7.8.2 │ ~7.8.1 │
│ typescript │ 6.0.3 │ ~6.0.3 │
│ zone.js │ 0.16.0 │ 0.16.0 │
└───────────────────────────┴───────────────────┴───────────────────┘
Anything else relevant?
No response
Activity
[-]Unit Test Builder Warning for custom builders[/-][+]Warning for Custom Builders When Running `ng test`[/+]alan-agius4 commentedon Aug 26, 2026
Hi @HazzMan2409,
This warning is intentional and accurate.
The
unit-testbuilder does not actually execute the builder configured inbuildTarget. Instead, it inspects the target to extract options and feeds them directly into@angular/build's internal application build pipeline.Because of this:
@angular-builders/custom-esbuild) and any custom logic they provide (such as custom esbuild plugins, loaders, or build lifecycle hooks) are not executed duringng test.The builder falls back to a best-effort execution with the options it can read, which is why this is a warning rather than a hard error. However, suppressing this warning would be misleading, as it would suggest that the custom builder is actively running and supported.
For these reasons, we cannot remove the warning for custom builders.
HazzMan2409 commentedon Aug 26, 2026
Hi @alan-agius4 thanks for that information.
My confusion comes from the fact that in that packages docs it states:
"The @angular-builders/custom-esbuild:unit-test builder is an enhanced version of the @angular/build:unit-test builder that reuses your application ESBuild plugins during test execution."
So essentially this custom builder will always be subject to the warning and there is really nothing they can do other than change their entire approach of building on top of @angular/build:unit-test to ensure it never appears.
If that package is doing something that is not supported by your team can you let me know and I can raise an issue there? If it is supported then that warning shouldn't really be happening I reckon.
angular-automatic-lock-bot commentedon Oct 20, 2026
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.