Karma builder issue with jasmine.clock() with "builderMode: application" #28813
Labels
area: @angular-devkit/build-angular
devkit/build-angular:karma
freq1: low
Only reported by a handful of users who observe it rarely
type: bug/fix
Command
test
Is this a regression?
The previous version in which this bug was not present was
No response
Description
When using
jasmine.clock()
, tests are throwing with the application builderMinimal Reproduction
Generate a new project with
npx @angular/[email protected] new karma-clock --defaults --no-routing
Update the test
app.component.spec.ts
with:Run the test: everything is fine.
Add "builderMode": "application", to angular.json in the karma options.
Run
ng test
again, the tests failException or Error
07 11 2024 18:11:04.827:INFO [Chrome 130.0.0.0 (Mac OS 10.15.7)]: Connected on socket cJzDaksNAB24vLcmAAAB with id 93837966
Chrome 130.0.0.0 (Mac OS 10.15.7) AppComponent should render title FAILED
Error: Jasmine Clock was unable to install over custom global timer functions. Is the clock already installed?
Your Environment
Angular CLI: 19.0.0-rc.1
Node: 20.13.1
Package Manager: npm 9.7.1
OS: darwin arm64
Angular: 19.0.0-rc.1
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
@angular-devkit/architect 0.1900.0-rc.1
@angular-devkit/build-angular 19.0.0-rc.1
@angular-devkit/core 19.0.0-rc.1
@angular-devkit/schematics 19.0.0-rc.1
@schematics/angular 19.0.0-rc.1
rxjs 7.8.1
typescript 5.6.3
zone.js 0.15.0
Anything else relevant?
No response
The text was updated successfully, but these errors were encountered: