angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

`unit-test` builder should allow users to disable teardown for debugging reasons

Open yjaaidi opened this issue 2 months ago • 0 comments

Command

test

Description

It would be nice to provide a way to disable teardown from the CLI.

This is useful in headed browser mode to interact with the mounted component in it's final state after the test ends.

Describe the solution you'd like

Maybe teardown could be disabled when --debug is set or maybe also provide a different boolean option such as teardown when using headed browser mode.

Describe alternatives you've considered

Once this is fixed https://github.com/angular/angular-cli/issues/31732, one can add a setup file with the following content:

TestBed.configureTestingModule({teardown: {destroyAfterEach: false}});

This could be configured dynamically at user's convenience.

yjaaidi avatar Nov 09 '25 17:11 yjaaidi