Skip to content

Commit a9741e6

Browse files
atscottalxhub
authored andcommitted
docs(router): deprecate RouterTestingModule (#54466)
Deprecate `RouterTestingModule` as it is no longer needed or useful and is not actively maintained. fixes #54461 PR Close #54466
1 parent fcfef52 commit a9741e6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

goldens/public-api/router/testing/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class RouterTestingHarness {
2424
get routeNativeElement(): HTMLElement | null;
2525
}
2626

27-
// @public
27+
// @public @deprecated
2828
export class RouterTestingModule {
2929
// (undocumented)
3030
static withRoutes(routes: Routes, config?: ExtraOptions): ModuleWithProviders<RouterTestingModule>;

packages/router/testing/src/router_testing_module.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ function throwInvalidConfigError(parameter: string): never {
6666
* ```
6767
*
6868
* @publicApi
69+
* @deprecated Use `provideRouter` or `RouterModule`/`RouterModule.forRoot` instead.
70+
* This module was previously used to provide a helpful collection of test fakes,
71+
* most notably those for `Location` and `LocationStrategy`. These are generally not
72+
* required anymore, as `MockPlatformLocation` is provided in `TestBed` by default.
73+
* However, you can use them directly with `provideLocationMocks`.
6974
*/
7075
@NgModule({
7176
exports: [RouterModule],

0 commit comments

Comments
 (0)