Command
test
Is this a regression?
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 ->
|
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
Command
test
Is this a regression?
The previous version in which this bug was not present was
No response
Description
Currently an
ng testwill warn if the builder used is not@angular/build:applicationor@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
Exception or Error
Your Environment
Anything else relevant?
No response