← All recipes
Moderne licensed

Add TestBed module teardown

Recipe IDorg.openrewrite.angular.migration.add-testbed-teardownArtifact@openrewrite/recipes-angular

Adds { teardown: { destroyAfterEach: true } } as the third argument to TestBed.initTestEnvironment() calls. Angular 13 changed the default teardown behavior, and this ensures explicit opt-in for module teardown after each test.

Single recipeProprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe org.openrewrite.angular.migration.add-testbed-teardown

If the recipe isn’t available locally, install it with:

mod config recipes npm install @openrewrite/recipes-angular