@angular-builders/custom-webpack:karma hanging with Angular v20
Describe the Bug
@angular-builders/custom-webpack:karma is hangind with "Incomplete: No specs found" message when an external karma config is utilized with Angular 20
Minimal Reproduction
https://github.com/danwulff/angular-builders_karma
Reproduction steps:
- clone repo
-
npm ci -
ng test
Steps used to create reproduction (also see commit history within repo):
-
npm i @angular/cli@20 -g -
ng new -
ng generate config karma - Steps found here: https://github.com/just-jeb/angular-builders/tree/master/packages/custom-webpack#usage
Expected Behavior
@angular-builders/custom-webpack:karma should work with Angular 20, with a karma config file.
Screenshots
Environment
Libs
- @angular/core version: 20.0.6
- @angular-devkit/build-angular version: n/a
- @angular/build version: 20.0.5
- @angular-builders/custom-webpack version: 20.0.0
For Tooling issues:
- Node version: v22.17.0
- NPM version: v10.9.2
- Platform: Mac
Additional Context
In @angular/cli v20 @angular/build is installed as a direct dependency instead of @angular-devkit/build-angular. However adding @angular-devkit/build-angular to the package.json does not resolve this issue.
I'm happy to debug further but without any error messaging I'm unsure where to go from here.
Removing "karmaConfig": "karma.conf.js" from angular.json also fixes the issue.
Ah ok, I think this may be a documentation issue actually.
https://github.com/danwulff/angular-builders_karma/compare/main...fix
In Angular 20 the ng generate config karma command does not include the @angular-devkit lines in the karma config. Adding those back from what Angular 19 generates seems to fix the issue.
I'm happy to open a PR to update the docs, but I'm uncertain where the docs should be updated.
https://github.com/just-jeb/angular-builders/tree/master/packages/custom-webpack
Maybe under Usage? or under Custom Webpack karma? Or would we prefer a new section added to the Readme?
Sounds like Custom Webpack karma is the right section (we're talking here about karma config here, right)? PR would be appreciated, thank you 🙏.
@just-jeb https://github.com/just-jeb/angular-builders/pull/1929 created