mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
26fed34e0e
This commit configures prettier to format markdown files.
RouterTestingModule Migration
This migration automatically converts deprecated RouterTestingModule usages to the recommended modern APIs.
What it does
- Replaces
RouterTestingModule.withRoutes([...])withRouterModule.forRoot([...])for NgModule tests - Replaces
RouterTestingModulewithRouterModule.forRoot([])when no routes are provided - For standalone tests (detected by presence of
providers), moves toprovideRouter([...])instead - Updates import statements to use
@angular/routerinstead of@angular/router/testing - Preserves other imports and test configuration
Files
router_testing_module_migration.ts- Main migration logic using TsurgeFunnelMigrationindex.ts- Entry point for the schematic../../test/router_testing_to_provide_router_spec.ts- Comprehensive test suiteMIGRATION_NOTES.md- Detailed documentation with examplesBUILD.bazel- Bazel build configuration
Running the migration
The migration runs automatically as part of ng update @angular/core for v21.0.0+.
To run manually:
ng update @angular/core --migrate-only router-testing-to-provide-router
Related
- Issue: angular/angular#54853
- Deprecation: angular/angular#54466