After Upgrade from Angular 14 to Angular 15, Tests No Longer Run
See original GitHub issueCommand
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
14.0.1
Description
I upgraded an Angular application from v14.0.1 to v15.0.2. The app builds without issue, but now when I run ng test, it does not find any tests. It doesn’t say that it doesn’t find any, but instead gives this output.

There are no errors in the browser console when this happens.
Minimal Reproduction
- Clone repo: https://github.com/mylifeandcode/workouttracker.git
- Get the code from the Angular15UpgradeTake2 branch
- Install packages
- Run ng test
Exception or Error
No error, just a Karma window that says ", randomized with seed " + the random number it used.
Your Environment
Angular CLI: 15.0.2
Node: 18.12.0
Package Manager: npm 8.3.0
OS: win32 x64
Angular: 15.0.2
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1500.2
@angular-devkit/build-angular 15.0.2
@angular-devkit/core 15.0.2
@angular-devkit/schematics 15.0.2
@angular/cdk 13.3.3
@schematics/angular 15.0.2
rxjs 6.6.7
typescript 4.8.4
Anything else relevant?
Here is a link to the commit where the upgrade was performed: https://github.com/mylifeandcode/workouttracker/commit/f0702b93ef15ea0e2dd175e5acb2876fadd8470e
I understand that for new apps the test.ts file will no longer be generated. My app still has it, but the code that appears to be what would once get the list of spec files to process was removed during the upgrade migrations: (https://github.com/mylifeandcode/workouttracker/commit/f0702b93ef15ea0e2dd175e5acb2876fadd8470e#diff-a4f4ad1111064cc43a8f876c1be0bd5ba98f1b2b18f6fdfff6fec7057d515599). If this is the case, it would explain why no tests get run, but what are the correct modifications to re-enable them?
I followed the steps listed in the update guide but did not see any instructions related to this. I only learned of the changes related to test.ts after some searching.
My application was originally written in Angular 4 and I’ve upgraded it over the years as new versions are released – I’m not sure if that would have any bearing on this or not. This most recent upgrade was from v14.0.1 to v15.0.2.
Thank you for your help!
Issue Analytics
- State:
- Created 9 months ago
- Comments:5
Thanks again for the help @alan-agius4 . The work you’ve all done on Angular is much appreciated, I love this framework. 😃
The test.ts didn’t change much since the first releases.
https://github.com/angular/devkit/blob/v0.3.1/packages/schematics/angular/application/files/__sourcedir__/test.ts
Anyways glad to see that the recommended change works.