Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(platform-browser): include Location mocks into testing environme…
…nt by default Currently, the `Location` and `LocationStrategy` mocks are added by the Router's testing module (the `RouterTestingModule`). However, the `Location` and `LocationStrategy` abstractions are parts of the `@angular/common` package and can be used outside of the Router logic to interact with the location. This PR adds the `Location` and `LocationStrategy` mocks into the `BrowserTestingModule` NgModule, which is used for environment setup in TestBed. Adding the mocks there has 2 main advantages: - `Location` and `LocationStrategy` mocks will always be setup when you use TestBed (note: if you provide location mocks in the TestBed.configureTestingModule, custom mocks would still be used), which would cover cases when the `Location` is used in apps code directly. - The Router would not need to provide the mocks for abstractions that belong to the different package (`@angular/common`), which should help simplify the standalone Router APIs for testing.
- Loading branch information