Skip to content

Test output directory grows with each test run and is not cleaned up #30751

@dkimmich-onventis

Description

@dkimmich-onventis

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

19

Description

When running Angular tests (e.g., with ng test), I noticed that the dist/test-out folder accumulates files and grows larger with every test run. The directory is not automatically cleaned or reset, which can eventually consume significant disk space. I have a case where the folder has grown to over 500 MB in just a few weeks.

Minimal Reproduction

  1. Generate a fresh Angular 20 project with ng new
  2. Run ng test --watch=false multiple times
  3. See the content of dist/test-out

Expected behavior:

Only the data of the latest test run is present

Actual behavior:

The data of all historic test runs is present

Exception or Error


Your Environment

Angular CLI: 20.1.1
Node: 22.17.0
Package Manager: npm 11.4.2
OS: darwin arm64

Angular: 20.1.2
... common, compiler, compiler-cli, core, forms
... platform-browser, router

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.2001.1
@angular-devkit/core         20.1.1
@angular-devkit/schematics   20.1.1
@angular/build               20.1.1
@angular/cli                 20.1.1
@schematics/angular          20.1.1
rxjs                         7.8.2
typescript                   5.8.3
zone.js                      0.15.1

Anything else relevant?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions